001    /**
002     * Copyright (c) 2000-2011 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 local service. This utility wraps {@link com.liferay.portal.service.impl.LayoutLocalServiceImpl} 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 LayoutLocalService
030     * @see com.liferay.portal.service.base.LayoutLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.LayoutLocalServiceImpl
032     * @generated
033     */
034    public class LayoutLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the layout to the database. Also notifies the appropriate model listeners.
043            *
044            * @param layout the layout
045            * @return the layout that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.Layout addLayout(
049                    com.liferay.portal.model.Layout layout)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addLayout(layout);
052            }
053    
054            /**
055            * Creates a new layout with the primary key. Does not add the layout to the database.
056            *
057            * @param plid the primary key for the new layout
058            * @return the new layout
059            */
060            public static com.liferay.portal.model.Layout createLayout(long plid) {
061                    return getService().createLayout(plid);
062            }
063    
064            /**
065            * Deletes the layout with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param plid the primary key of the layout
068            * @throws PortalException if a layout with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public static void deleteLayout(long plid)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService().deleteLayout(plid);
075            }
076    
077            /**
078            * Deletes the layout from the database. Also notifies the appropriate model listeners.
079            *
080            * @param layout the layout
081            * @throws SystemException if a system exception occurred
082            */
083            public static void deleteLayout(com.liferay.portal.model.Layout layout)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    getService().deleteLayout(layout);
086            }
087    
088            /**
089            * Performs a dynamic query on the database and returns the matching rows.
090            *
091            * @param dynamicQuery the dynamic query
092            * @return the matching rows
093            * @throws SystemException if a system exception occurred
094            */
095            @SuppressWarnings("rawtypes")
096            public static java.util.List dynamicQuery(
097                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
098                    throws com.liferay.portal.kernel.exception.SystemException {
099                    return getService().dynamicQuery(dynamicQuery);
100            }
101    
102            /**
103            * Performs a dynamic query on the database and returns a range of the matching rows.
104            *
105            * <p>
106            * 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.
107            * </p>
108            *
109            * @param dynamicQuery the dynamic query
110            * @param start the lower bound of the range of model instances
111            * @param end the upper bound of the range of model instances (not inclusive)
112            * @return the range of matching rows
113            * @throws SystemException if a system exception occurred
114            */
115            @SuppressWarnings("rawtypes")
116            public static java.util.List dynamicQuery(
117                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
118                    int end) throws com.liferay.portal.kernel.exception.SystemException {
119                    return getService().dynamicQuery(dynamicQuery, start, end);
120            }
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * 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.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public static java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getService()
143                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
144            }
145    
146            /**
147            * Returns the number of rows that match the dynamic query.
148            *
149            * @param dynamicQuery the dynamic query
150            * @return the number of rows that match the dynamic query
151            * @throws SystemException if a system exception occurred
152            */
153            public static long dynamicQueryCount(
154                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
155                    throws com.liferay.portal.kernel.exception.SystemException {
156                    return getService().dynamicQueryCount(dynamicQuery);
157            }
158    
159            public static com.liferay.portal.model.Layout fetchLayout(long plid)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getService().fetchLayout(plid);
162            }
163    
164            /**
165            * Returns the layout with the primary key.
166            *
167            * @param plid the primary key of the layout
168            * @return the layout
169            * @throws PortalException if a layout with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.Layout getLayout(long plid)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    return getService().getLayout(plid);
176            }
177    
178            public static com.liferay.portal.model.PersistedModel getPersistedModel(
179                    java.io.Serializable primaryKeyObj)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getService().getPersistedModel(primaryKeyObj);
183            }
184    
185            /**
186            * Returns the layout with the UUID in the group.
187            *
188            * @param uuid the UUID of layout
189            * @param groupId the group id of the layout
190            * @return the layout
191            * @throws PortalException if a layout with the UUID in the group could not be found
192            * @throws SystemException if a system exception occurred
193            */
194            public static com.liferay.portal.model.Layout getLayoutByUuidAndGroupId(
195                    java.lang.String uuid, long groupId)
196                    throws com.liferay.portal.kernel.exception.PortalException,
197                            com.liferay.portal.kernel.exception.SystemException {
198                    return getService().getLayoutByUuidAndGroupId(uuid, groupId);
199            }
200    
201            /**
202            * Returns a range of all the layouts.
203            *
204            * <p>
205            * 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.
206            * </p>
207            *
208            * @param start the lower bound of the range of layouts
209            * @param end the upper bound of the range of layouts (not inclusive)
210            * @return the range of layouts
211            * @throws SystemException if a system exception occurred
212            */
213            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
214                    int start, int end)
215                    throws com.liferay.portal.kernel.exception.SystemException {
216                    return getService().getLayouts(start, end);
217            }
218    
219            /**
220            * Returns the number of layouts.
221            *
222            * @return the number of layouts
223            * @throws SystemException if a system exception occurred
224            */
225            public static int getLayoutsCount()
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getService().getLayoutsCount();
228            }
229    
230            /**
231            * Updates the layout in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
232            *
233            * @param layout the layout
234            * @return the layout that was updated
235            * @throws SystemException if a system exception occurred
236            */
237            public static com.liferay.portal.model.Layout updateLayout(
238                    com.liferay.portal.model.Layout layout)
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getService().updateLayout(layout);
241            }
242    
243            /**
244            * Updates the layout in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
245            *
246            * @param layout the layout
247            * @param merge whether to merge the layout 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.
248            * @return the layout that was updated
249            * @throws SystemException if a system exception occurred
250            */
251            public static com.liferay.portal.model.Layout updateLayout(
252                    com.liferay.portal.model.Layout layout, boolean merge)
253                    throws com.liferay.portal.kernel.exception.SystemException {
254                    return getService().updateLayout(layout, merge);
255            }
256    
257            /**
258            * Returns the Spring bean ID for this bean.
259            *
260            * @return the Spring bean ID for this bean
261            */
262            public static java.lang.String getBeanIdentifier() {
263                    return getService().getBeanIdentifier();
264            }
265    
266            /**
267            * Sets the Spring bean ID for this bean.
268            *
269            * @param beanIdentifier the Spring bean ID for this bean
270            */
271            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
272                    getService().setBeanIdentifier(beanIdentifier);
273            }
274    
275            /**
276            * Adds a layout with additional parameters.
277            *
278            * <p>
279            * This method handles the creation of the layout including its resources,
280            * metadata, and internal data structures. It is not necessary to make
281            * subsequent calls to any methods to setup default groups, resources, ...
282            * etc.
283            * </p>
284            *
285            * @param userId the primary key of the user
286            * @param groupId the primary key of the group
287            * @param privateLayout whether the layout is private to the group
288            * @param parentLayoutId the primary key of the parent layout (optionally
289            {@link
290            com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID})
291            * @param nameMap the layout's locales and localized names
292            * @param titleMap the layout's locales and localized titles
293            * @param descriptionMap the layout's locales and localized descriptions
294            * @param keywordsMap the layout's locales and localized keywords
295            * @param robotsMap the layout's locales and localized robots
296            * @param type the layout's type (optionally {@link
297            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The
298            possible types can be found in {@link
299            com.liferay.portal.model.LayoutConstants}.
300            * @param hidden whether the layout is hidden
301            * @param friendlyURL the layout's friendly URL (optionally {@link
302            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
303            or {@link
304            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}).
305            The default values can be overridden in
306            <code>portal-ext.properties</code> by specifying new values for
307            the corresponding properties defined in {@link
308            com.liferay.portal.util.PropsValues}. To see how the URL is
309            normalized when accessed see {@link
310            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
311            String)}.
312            * @param serviceContext the service context. Must set the universally
313            unique identifier (UUID) for the layout. Can set the creation
314            date, modification date and the expando bridge attributes for the
315            layout. For layouts that belong to a layout set prototype, an
316            attribute named 'layoutUpdateable' can be set to specify whether
317            site administrators can modify this page within their site. For
318            layouts that are created from a layout prototype, attributes
319            named 'layoutPrototypeUuid' and 'layoutPrototypeLinkedEnabled'
320            can be specified to provide the unique identifier of the source
321            prototype and a boolean to determined whether a link to it should
322            be enabled to activate propagation of changes made to the linked
323            page in the prototype.
324            * @return the layout
325            * @throws PortalException if a group or user with the primary key could not
326            be found, or if layout values were invalid
327            * @throws SystemException if a system exception occurred
328            */
329            public static com.liferay.portal.model.Layout addLayout(long userId,
330                    long groupId, boolean privateLayout, long parentLayoutId,
331                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
332                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
333                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
334                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
335                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
336                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
337                    com.liferay.portal.service.ServiceContext serviceContext)
338                    throws com.liferay.portal.kernel.exception.PortalException,
339                            com.liferay.portal.kernel.exception.SystemException {
340                    return getService()
341                                       .addLayout(userId, groupId, privateLayout, parentLayoutId,
342                            nameMap, titleMap, descriptionMap, keywordsMap, robotsMap, type,
343                            hidden, friendlyURL, serviceContext);
344            }
345    
346            /**
347            * Adds a layout.
348            *
349            * <p>
350            * This method handles the creation of the layout including its resources,
351            * metadata, and internal data structures. It is not necessary to make
352            * subsequent calls to any methods to setup default groups, resources, ...
353            * etc.
354            * </p>
355            *
356            * @param userId the primary key of the user
357            * @param groupId the primary key of the group
358            * @param privateLayout whether the layout is private to the group
359            * @param parentLayoutId the primary key of the parent layout (optionally
360            {@link
361            com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID}).
362            The possible values can be found in {@link
363            com.liferay.portal.model.LayoutConstants}.
364            * @param name the layout's name (optionally {@link
365            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME}
366            or {@link
367            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME}).
368            The default values can be overridden in
369            <code>portal-ext.properties</code> by specifying new values for
370            the corresponding properties defined in {@link
371            com.liferay.portal.util.PropsValues}
372            * @param title the layout's title
373            * @param description the layout's description
374            * @param type the layout's type (optionally {@link
375            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The
376            possible types can be found in {@link
377            com.liferay.portal.model.LayoutConstants}.
378            * @param hidden whether the layout is hidden
379            * @param friendlyURL the friendly URL of the layout (optionally {@link
380            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
381            or {@link
382            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}).
383            The default values can be overridden in
384            <code>portal-ext.properties</code> by specifying new values for
385            the corresponding properties defined in {@link
386            com.liferay.portal.util.PropsValues}. To see how the URL is
387            normalized when accessed see {@link
388            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
389            String)}.
390            * @param serviceContext the service context. Must set the universally
391            unique identifier (UUID) for the layout. Can set the creation
392            date and modification date for the layout. For layouts that
393            belong to a layout set prototype, an attribute named
394            'layoutUpdateable' can be set to specify whether site
395            administrators can modify this page within their site.
396            * @return the layout
397            * @throws PortalException if a group or user with the primary key could not
398            be found
399            * @throws SystemException if a system exception occurred
400            */
401            public static com.liferay.portal.model.Layout addLayout(long userId,
402                    long groupId, boolean privateLayout, long parentLayoutId,
403                    java.lang.String name, java.lang.String title,
404                    java.lang.String description, java.lang.String type, boolean hidden,
405                    java.lang.String friendlyURL,
406                    com.liferay.portal.service.ServiceContext serviceContext)
407                    throws com.liferay.portal.kernel.exception.PortalException,
408                            com.liferay.portal.kernel.exception.SystemException {
409                    return getService()
410                                       .addLayout(userId, groupId, privateLayout, parentLayoutId,
411                            name, title, description, type, hidden, friendlyURL, serviceContext);
412            }
413    
414            /**
415            * Deletes the layout, its child layouts, and its associated resources.
416            *
417            * @param layout the layout
418            * @param updateLayoutSet whether the layout set's page counter needs to be
419            updated
420            * @param serviceContext the service context
421            * @throws PortalException if a portal exception occurred
422            * @throws SystemException if a system exception occurred
423            */
424            public static void deleteLayout(com.liferay.portal.model.Layout layout,
425                    boolean updateLayoutSet,
426                    com.liferay.portal.service.ServiceContext serviceContext)
427                    throws com.liferay.portal.kernel.exception.PortalException,
428                            com.liferay.portal.kernel.exception.SystemException {
429                    getService().deleteLayout(layout, updateLayoutSet, serviceContext);
430            }
431    
432            /**
433            * Deletes the layout with the primary key, also deleting the layout's child
434            * layouts, and associated resources.
435            *
436            * @param groupId the primary key of the group
437            * @param privateLayout whether the layout is private to the group
438            * @param layoutId the primary key of the layout
439            * @param serviceContext the service context
440            * @throws PortalException if a matching layout could not be found , or if
441            some other portal exception occurred
442            * @throws SystemException if a system exception occurred
443            */
444            public static void deleteLayout(long groupId, boolean privateLayout,
445                    long layoutId, com.liferay.portal.service.ServiceContext serviceContext)
446                    throws com.liferay.portal.kernel.exception.PortalException,
447                            com.liferay.portal.kernel.exception.SystemException {
448                    getService()
449                            .deleteLayout(groupId, privateLayout, layoutId, serviceContext);
450            }
451    
452            /**
453            * Deletes the layout with the plid, also deleting the layout's child
454            * layouts, and associated resources.
455            *
456            * @param plid the primary key of the layout
457            * @param serviceContext the service context
458            * @throws PortalException if a layout with the primary key could not be
459            found , or if some other portal exception occurred
460            * @throws SystemException if a system exception occurred
461            */
462            public static void deleteLayout(long plid,
463                    com.liferay.portal.service.ServiceContext serviceContext)
464                    throws com.liferay.portal.kernel.exception.PortalException,
465                            com.liferay.portal.kernel.exception.SystemException {
466                    getService().deleteLayout(plid, serviceContext);
467            }
468    
469            /**
470            * Deletes the group's private or non-private layouts, also deleting the
471            * layouts' child layouts, and associated resources.
472            *
473            * @param groupId the primary key of the group
474            * @param privateLayout whether the layout is private to the group
475            * @param serviceContext the service context
476            * @throws PortalException if a group with the primary key could not be
477            found or if a layout set for the group and privacy could not be
478            found
479            * @throws SystemException if a system exception occurred
480            */
481            public static void deleteLayouts(long groupId, boolean privateLayout,
482                    com.liferay.portal.service.ServiceContext serviceContext)
483                    throws com.liferay.portal.kernel.exception.PortalException,
484                            com.liferay.portal.kernel.exception.SystemException {
485                    getService().deleteLayouts(groupId, privateLayout, serviceContext);
486            }
487    
488            /**
489            * Exports layouts with the primary keys and criteria as a byte array.
490            *
491            * @param groupId the primary key of the group
492            * @param privateLayout whether the layout is private to the group
493            * @param layoutIds the primary keys of the layouts to be exported
494            * @param parameterMap the mapping of parameters indicating which
495            information to export. For information on the keys used in the
496            map see {@link
497            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
498            * @param startDate the export's start date
499            * @param endDate the export's end date
500            * @return the layouts as a byte array
501            * @throws PortalException if a group or any layout with the primary key
502            could not be found, or if some other portal exception occurred
503            * @throws SystemException if a system exception occurred
504            */
505            public static byte[] exportLayouts(long groupId, boolean privateLayout,
506                    long[] layoutIds,
507                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
508                    java.util.Date startDate, java.util.Date endDate)
509                    throws com.liferay.portal.kernel.exception.PortalException,
510                            com.liferay.portal.kernel.exception.SystemException {
511                    return getService()
512                                       .exportLayouts(groupId, privateLayout, layoutIds,
513                            parameterMap, startDate, endDate);
514            }
515    
516            /**
517            * Exports all layouts that match the criteria as a byte array.
518            *
519            * @param groupId the primary key of the group
520            * @param privateLayout whether the layout is private to the group
521            * @param parameterMap the mapping of parameters indicating which
522            information to export. For information on the keys used in the
523            map see {@link
524            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
525            * @param startDate the export's start date
526            * @param endDate the export's end date
527            * @return the layout as a byte array
528            * @throws PortalException if a group with the primary key could not be
529            found or if some other portal exception occurred
530            * @throws SystemException if a system exception occurred
531            */
532            public static byte[] exportLayouts(long groupId, boolean privateLayout,
533                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
534                    java.util.Date startDate, java.util.Date endDate)
535                    throws com.liferay.portal.kernel.exception.PortalException,
536                            com.liferay.portal.kernel.exception.SystemException {
537                    return getService()
538                                       .exportLayouts(groupId, privateLayout, parameterMap,
539                            startDate, endDate);
540            }
541    
542            /**
543            * Exports the layouts that match the primary keys and criteria as a file.
544            *
545            * @param groupId the primary key of the group
546            * @param privateLayout whether the layout is private to the group
547            * @param layoutIds the primary keys of the layouts to be exported
548            (optionally <code>null</code>)
549            * @param parameterMap the mapping of parameters indicating which
550            information to export. For information on the keys used in the
551            map see {@link
552            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
553            * @param startDate the export's start date
554            * @param endDate the export's end date
555            * @return the layouts as a File
556            * @throws PortalException if a group or any layout with the primary key
557            could not be found, or if some other portal exception occurred
558            * @throws SystemException if a system exception occurred
559            */
560            public static java.io.File exportLayoutsAsFile(long groupId,
561                    boolean privateLayout, long[] layoutIds,
562                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
563                    java.util.Date startDate, java.util.Date endDate)
564                    throws com.liferay.portal.kernel.exception.PortalException,
565                            com.liferay.portal.kernel.exception.SystemException {
566                    return getService()
567                                       .exportLayoutsAsFile(groupId, privateLayout, layoutIds,
568                            parameterMap, startDate, endDate);
569            }
570    
571            /**
572            * Exports the portlet information (categories, permissions, ... etc.) as a
573            * byte array.
574            *
575            * @param plid the primary key of the layout
576            * @param groupId the primary key of the group
577            * @param portletId the primary key of the portlet
578            * @param parameterMap the mapping of parameters indicating which
579            information to export. For information on the keys used in the
580            map see {@link
581            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
582            * @param startDate the export's start date
583            * @param endDate the export's end date
584            * @return the portlet information as a byte array
585            * @throws PortalException if a group or portlet with the primary key could
586            not be found, or if some other portal exception occurred
587            * @throws SystemException if a system exception occurred
588            */
589            public static byte[] exportPortletInfo(long plid, long groupId,
590                    java.lang.String portletId,
591                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
592                    java.util.Date startDate, java.util.Date endDate)
593                    throws com.liferay.portal.kernel.exception.PortalException,
594                            com.liferay.portal.kernel.exception.SystemException {
595                    return getService()
596                                       .exportPortletInfo(plid, groupId, portletId, parameterMap,
597                            startDate, endDate);
598            }
599    
600            /**
601            * Exports the portlet information (categories, permissions, ... etc.) as a
602            * file.
603            *
604            * @param plid the primary key of the layout
605            * @param groupId the primary key of the group
606            * @param portletId the primary key of the portlet
607            * @param parameterMap the mapping of parameters indicating which
608            information to export. For information on the keys used in the
609            map see {@link
610            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
611            * @param startDate the export's start date
612            * @param endDate the export's end date
613            * @return the portlet information as a file
614            * @throws PortalException if a group or portlet with the primary key could
615            not be found, or if some other portal exception occurred
616            * @throws SystemException if a system exception occurred
617            */
618            public static java.io.File exportPortletInfoAsFile(long plid, long groupId,
619                    java.lang.String portletId,
620                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
621                    java.util.Date startDate, java.util.Date endDate)
622                    throws com.liferay.portal.kernel.exception.PortalException,
623                            com.liferay.portal.kernel.exception.SystemException {
624                    return getService()
625                                       .exportPortletInfoAsFile(plid, groupId, portletId,
626                            parameterMap, startDate, endDate);
627            }
628    
629            public static com.liferay.portal.model.Layout fetchFirstLayout(
630                    long groupId, boolean privateLayout, long parentLayoutId)
631                    throws com.liferay.portal.kernel.exception.SystemException {
632                    return getService()
633                                       .fetchFirstLayout(groupId, privateLayout, parentLayoutId);
634            }
635    
636            /**
637            * Returns the layout matching the universally unique identifier and group
638            * ID
639            *
640            * @param uuid the universally unique identifier of the scope layout
641            * @param groupId the primary key of the group
642            * @return the layout, or <code>null</code> if a matching layout could not
643            be found
644            * @throws SystemException if a system exception occurred
645            */
646            public static com.liferay.portal.model.Layout fetchLayoutByUuidAndGroupId(
647                    java.lang.String uuid, long groupId)
648                    throws com.liferay.portal.kernel.exception.SystemException {
649                    return getService().fetchLayoutByUuidAndGroupId(uuid, groupId);
650            }
651    
652            /**
653            * Returns the primary key of the default layout for the group
654            *
655            * @param groupId the primary key of the group
656            * @return the primary key of the default layout for the group (optionally
657            {@link com.liferay.portal.model.LayoutConstants#DEFAULT_PLID})
658            * @throws SystemException if a system exception occurred
659            */
660            public static long getDefaultPlid(long groupId)
661                    throws com.liferay.portal.kernel.exception.SystemException {
662                    return getService().getDefaultPlid(groupId);
663            }
664    
665            /**
666            * Returns primary key of the matching default layout for the group
667            *
668            * @param groupId the primary key of the group
669            * @param privateLayout whether the layout is private to the group
670            * @return the primary key of the default layout for the group; {@link
671            com.liferay.portal.model.LayoutConstants#DEFAULT_PLID}) otherwise
672            * @throws SystemException if a system exception occurred
673            */
674            public static long getDefaultPlid(long groupId, boolean privateLayout)
675                    throws com.liferay.portal.kernel.exception.SystemException {
676                    return getService().getDefaultPlid(groupId, privateLayout);
677            }
678    
679            /**
680            * Returns primary key of the default portlet layout for the group
681            *
682            * @param groupId the primary key of the group
683            * @param privateLayout whether the layout is private to the group
684            * @param portletId the primary key of the portlet
685            * @return the primary key of the default portlet layout for the group;
686            {@link com.liferay.portal.model.LayoutConstants#DEFAULT_PLID}
687            otherwise
688            * @throws PortalException if a portlet with the primary key could not be
689            found
690            * @throws SystemException if a system exception occurred
691            */
692            public static long getDefaultPlid(long groupId, boolean privateLayout,
693                    java.lang.String portletId)
694                    throws com.liferay.portal.kernel.exception.PortalException,
695                            com.liferay.portal.kernel.exception.SystemException {
696                    return getService().getDefaultPlid(groupId, privateLayout, portletId);
697            }
698    
699            /**
700            * Returns the layout for the friendly URL
701            *
702            * @param groupId the primary key of the group
703            * @param privateLayout whether the layout is private to the group
704            * @param friendlyURL the friendly URL of the layout
705            * @return the layout for the friendly URL
706            * @throws PortalException if the friendly URL is <code>null</code> or a
707            matching layout could not be found
708            * @throws SystemException if a system exception occurred
709            */
710            public static com.liferay.portal.model.Layout getFriendlyURLLayout(
711                    long groupId, boolean privateLayout, java.lang.String friendlyURL)
712                    throws com.liferay.portal.kernel.exception.PortalException,
713                            com.liferay.portal.kernel.exception.SystemException {
714                    return getService()
715                                       .getFriendlyURLLayout(groupId, privateLayout, friendlyURL);
716            }
717    
718            /**
719            * Returns the layout matching the primary key, group, and privacy; throws a
720            * {@link com.liferay.portal.NoSuchLayoutException} otherwise.
721            *
722            * @param groupId the primary key of the group
723            * @param privateLayout whether the layout is private to the group
724            * @param layoutId the primary key of the layout
725            * @return the matching layout
726            * @throws PortalException if a matching layout could not be found
727            * @throws SystemException if a system exception occurred
728            */
729            public static com.liferay.portal.model.Layout getLayout(long groupId,
730                    boolean privateLayout, long layoutId)
731                    throws com.liferay.portal.kernel.exception.PortalException,
732                            com.liferay.portal.kernel.exception.SystemException {
733                    return getService().getLayout(groupId, privateLayout, layoutId);
734            }
735    
736            /**
737            * Returns the layout for the icon image; throws a {@link
738            * com.liferay.portal.NoSuchLayoutException} otherwise.
739            *
740            * @param iconImageId the primary key of the icon image
741            * @return Returns the layout for the icon image
742            * @throws PortalException if an icon image with the primary key could not
743            be found
744            * @throws SystemException if a system exception occurred
745            */
746            public static com.liferay.portal.model.Layout getLayoutByIconImageId(
747                    long iconImageId)
748                    throws com.liferay.portal.kernel.exception.PortalException,
749                            com.liferay.portal.kernel.exception.SystemException {
750                    return getService().getLayoutByIconImageId(iconImageId);
751            }
752    
753            /**
754            * Returns all the layouts belonging to the group.
755            *
756            * @param groupId the primary key of the group
757            * @param privateLayout whether the layout is private to the group
758            * @return the matching layouts, or <code>null</code> if no matches were
759            found
760            * @throws SystemException if a system exception occurred
761            */
762            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
763                    long groupId, boolean privateLayout)
764                    throws com.liferay.portal.kernel.exception.SystemException {
765                    return getService().getLayouts(groupId, privateLayout);
766            }
767    
768            /**
769            * Returns all the layouts belonging to the group that are children of the
770            * parent layout.
771            *
772            * @param groupId the primary key of the group
773            * @param privateLayout whether the layout is private to the group
774            * @param parentLayoutId the primary key of the parent layout
775            * @return the matching layouts, or <code>null</code> if no matches were
776            found
777            * @throws SystemException if a system exception occurred
778            */
779            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
780                    long groupId, boolean privateLayout, long parentLayoutId)
781                    throws com.liferay.portal.kernel.exception.SystemException {
782                    return getService().getLayouts(groupId, privateLayout, parentLayoutId);
783            }
784    
785            /**
786            * Returns a range of all the layouts belonging to the group that are
787            * children of the parent layout.
788            *
789            * <p>
790            * Useful when paginating results. Returns a maximum of <code>end -
791            * start</code> instances. <code>start</code> and <code>end</code> are not
792            * primary keys, they are indexes in the result set. Thus, <code>0</code>
793            * refers to the first result in the set. Setting both <code>start</code>
794            * and <code>end</code> to {@link
795            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
796            * result set.
797            * </p>
798            *
799            * @param groupId the primary key of the group
800            * @param privateLayout whether the layout is private to the group
801            * @param parentLayoutId the primary key of the parent layout
802            * @param incomplete whether the layout is incomplete
803            * @param start the lower bound of the range of layouts
804            * @param end the upper bound of the range of layouts (not inclusive)
805            * @return the matching layouts, or <code>null</code> if no matches were
806            found
807            * @throws SystemException if a system exception occurred
808            */
809            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
810                    long groupId, boolean privateLayout, long parentLayoutId,
811                    boolean incomplete, int start, int end)
812                    throws com.liferay.portal.kernel.exception.SystemException {
813                    return getService()
814                                       .getLayouts(groupId, privateLayout, parentLayoutId,
815                            incomplete, start, end);
816            }
817    
818            /**
819            * Returns all the layouts that match the layout IDs and belong to the
820            * group.
821            *
822            * @param groupId the primary key of the group
823            * @param privateLayout whether the layout is private to the group
824            * @param layoutIds the primary keys of the layouts
825            * @return the matching layouts, or <code>null</code> if no matches were
826            found
827            * @throws PortalException if a group or layout with the primary key could
828            not be found
829            * @throws SystemException if a system exception occurred
830            */
831            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
832                    long groupId, boolean privateLayout, long[] layoutIds)
833                    throws com.liferay.portal.kernel.exception.PortalException,
834                            com.liferay.portal.kernel.exception.SystemException {
835                    return getService().getLayouts(groupId, privateLayout, layoutIds);
836            }
837    
838            /**
839            * Returns all the layouts that match the type and belong to the group.
840            *
841            * @param groupId the primary key of the group
842            * @param privateLayout whether the layout is private to the group
843            * @param type the type of the layouts (optionally {@link
844            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET})
845            * @return the matching layouts, or <code>null</code> if no matches were
846            found
847            * @throws SystemException if a system exception occurred
848            */
849            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
850                    long groupId, boolean privateLayout, java.lang.String type)
851                    throws com.liferay.portal.kernel.exception.SystemException {
852                    return getService().getLayouts(groupId, privateLayout, type);
853            }
854    
855            /**
856            * Returns the layout references for all the layouts that belong to the
857            * company and belong to the portlet that matches the preferences.
858            *
859            * @param companyId the primary key of the company
860            * @param portletId the primary key of the portlet
861            * @param preferencesKey the portlet's preference key
862            * @param preferencesValue the portlet's preference value
863            * @return the layout references of the matching layouts
864            * @throws SystemException if a system exception occurred
865            */
866            public static com.liferay.portal.model.LayoutReference[] getLayouts(
867                    long companyId, java.lang.String portletId,
868                    java.lang.String preferencesKey, java.lang.String preferencesValue)
869                    throws com.liferay.portal.kernel.exception.SystemException {
870                    return getService()
871                                       .getLayouts(companyId, portletId, preferencesKey,
872                            preferencesValue);
873            }
874    
875            /**
876            * Returns the primary key to use for the next layout.
877            *
878            * @param groupId the primary key of the group
879            * @param privateLayout whether the layout is private to the group
880            * @return the primary key to use for the next layout
881            * @throws SystemException if a system exception occurred
882            */
883            public static long getNextLayoutId(long groupId, boolean privateLayout)
884                    throws com.liferay.portal.kernel.exception.SystemException {
885                    return getService().getNextLayoutId(groupId, privateLayout);
886            }
887    
888            /**
889            * Returns all the layouts whose friendly URLs are <code>null</code>
890            *
891            * @return all the layouts whose friendly URLs are <code>null</code>
892            * @throws SystemException if a system exception occurred
893            */
894            public static java.util.List<com.liferay.portal.model.Layout> getNullFriendlyURLLayouts()
895                    throws com.liferay.portal.kernel.exception.SystemException {
896                    return getService().getNullFriendlyURLLayouts();
897            }
898    
899            /**
900            * Returns all the layouts within scope of the group
901            *
902            * @param groupId the primary key of the group
903            * @param privateLayout whether the layout is private to the group
904            * @return the layouts within scope of the group
905            * @throws SystemException if a system exception occurred
906            */
907            public static java.util.List<com.liferay.portal.model.Layout> getScopeGroupLayouts(
908                    long groupId, boolean privateLayout)
909                    throws com.liferay.portal.kernel.exception.SystemException {
910                    return getService().getScopeGroupLayouts(groupId, privateLayout);
911            }
912    
913            /**
914            * Returns <code>true</code> if the group has any layouts;
915            * <code>false</code> otherwise.
916            *
917            * @param groupId the primary key of the group
918            * @param privateLayout whether the layout is private to the group
919            * @param parentLayoutId the primary key of the parent layout
920            * @return <code>true</code> if the group has any layouts;
921            <code>false</code> otherwise
922            * @throws SystemException if a system exception occurred
923            */
924            public static boolean hasLayouts(long groupId, boolean privateLayout,
925                    long parentLayoutId)
926                    throws com.liferay.portal.kernel.exception.SystemException {
927                    return getService().hasLayouts(groupId, privateLayout, parentLayoutId);
928            }
929    
930            /**
931            * Imports the layouts from the byte array.
932            *
933            * @param userId the primary key of the user
934            * @param groupId the primary key of the group
935            * @param privateLayout whether the layout is private to the group
936            * @param parameterMap the mapping of parameters indicating which
937            information will be imported. For information on the keys used in
938            the map see {@link
939            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
940            * @param bytes the byte array with the data
941            * @throws PortalException if a group or user with the primary key could not
942            be found, or if some other portal exception occurred
943            * @throws SystemException if a system exception occurred
944            * @see com.liferay.portal.lar.LayoutImporter
945            */
946            public static void importLayouts(long userId, long groupId,
947                    boolean privateLayout,
948                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
949                    byte[] bytes)
950                    throws com.liferay.portal.kernel.exception.PortalException,
951                            com.liferay.portal.kernel.exception.SystemException {
952                    getService()
953                            .importLayouts(userId, groupId, privateLayout, parameterMap, bytes);
954            }
955    
956            /**
957            * Imports the layouts from the file.
958            *
959            * @param userId the primary key of the user
960            * @param groupId the primary key of the group
961            * @param privateLayout whether the layout is private to the group
962            * @param parameterMap the mapping of parameters indicating which
963            information will be imported. For information on the keys used in
964            the map see {@link
965            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
966            * @param file the LAR file with the data
967            * @throws PortalException if a group or user with the primary key could not
968            be found, or if some other portal exception occurred
969            * @throws SystemException if a system exception occurred
970            * @see com.liferay.portal.lar.LayoutImporter
971            */
972            public static void importLayouts(long userId, long groupId,
973                    boolean privateLayout,
974                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
975                    java.io.File file)
976                    throws com.liferay.portal.kernel.exception.PortalException,
977                            com.liferay.portal.kernel.exception.SystemException {
978                    getService()
979                            .importLayouts(userId, groupId, privateLayout, parameterMap, file);
980            }
981    
982            /**
983            * Imports the layouts from the input stream.
984            *
985            * @param userId the primary key of the user
986            * @param groupId the primary key of the group
987            * @param privateLayout whether the layout is private to the group
988            * @param parameterMap the mapping of parameters indicating which
989            information will be imported. For information on the keys used in
990            the map see {@link
991            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
992            * @param is the input stream
993            * @throws PortalException if a group or user with the primary key could not
994            be found, or if some other portal exception occurred
995            * @throws SystemException if a system exception occurred
996            * @see com.liferay.portal.lar.LayoutImporter
997            */
998            public static void importLayouts(long userId, long groupId,
999                    boolean privateLayout,
1000                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1001                    java.io.InputStream is)
1002                    throws com.liferay.portal.kernel.exception.PortalException,
1003                            com.liferay.portal.kernel.exception.SystemException {
1004                    getService()
1005                            .importLayouts(userId, groupId, privateLayout, parameterMap, is);
1006            }
1007    
1008            /**
1009            * Imports the portlet information (categories, permissions, ... etc.) from
1010            * the file.
1011            *
1012            * @param userId the primary key of the user
1013            * @param plid the primary key of the target layout
1014            * @param groupId the primary key of the target group
1015            * @param portletId the primary key of the portlet
1016            * @param parameterMap the mapping of parameters indicating which
1017            information will be imported. For information on the keys used in
1018            the map see {@link
1019            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1020            * @param file the LAR file with the data
1021            * @throws PortalException if a group, layout, portlet or user with the
1022            primary key could not be found
1023            * @throws SystemException if a system exception occurred
1024            */
1025            public static void importPortletInfo(long userId, long plid, long groupId,
1026                    java.lang.String portletId,
1027                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1028                    java.io.File file)
1029                    throws com.liferay.portal.kernel.exception.PortalException,
1030                            com.liferay.portal.kernel.exception.SystemException {
1031                    getService()
1032                            .importPortletInfo(userId, plid, groupId, portletId, parameterMap,
1033                            file);
1034            }
1035    
1036            /**
1037            * Imports the portlet information (categories, permissions, ... etc.) from
1038            * the input stream.
1039            *
1040            * @param userId the primary key of the user
1041            * @param plid the primary key of the layout
1042            * @param groupId the primary key of the group
1043            * @param portletId the primary key of the portlet
1044            * @param parameterMap the mapping of parameters indicating which
1045            information will be imported. For information on the keys used in
1046            the map see {@link
1047            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1048            * @param is the input stream
1049            * @throws PortalException if a group, portlet, layout or user with the
1050            primary key could not be found
1051            * @throws SystemException if a system exception occurred
1052            */
1053            public static void importPortletInfo(long userId, long plid, long groupId,
1054                    java.lang.String portletId,
1055                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1056                    java.io.InputStream is)
1057                    throws com.liferay.portal.kernel.exception.PortalException,
1058                            com.liferay.portal.kernel.exception.SystemException {
1059                    getService()
1060                            .importPortletInfo(userId, plid, groupId, portletId, parameterMap,
1061                            is);
1062            }
1063    
1064            /**
1065            * Sets the layouts for the group, replacing and prioritizing all layouts of
1066            * the parent layout.
1067            *
1068            * @param groupId the primary key of the group
1069            * @param privateLayout whether the layout is private to the group
1070            * @param parentLayoutId the primary key of the parent layout
1071            * @param layoutIds the primary keys of the layouts
1072            * @param serviceContext the service context
1073            * @throws PortalException if a group or layout with the primary key could
1074            not be found, if no layouts were specified, if the first layout
1075            was not page-able, if the first layout was hidden, or if some
1076            other portal exception occurred
1077            * @throws SystemException if a system exception occurred
1078            */
1079            public static void setLayouts(long groupId, boolean privateLayout,
1080                    long parentLayoutId, long[] layoutIds,
1081                    com.liferay.portal.service.ServiceContext serviceContext)
1082                    throws com.liferay.portal.kernel.exception.PortalException,
1083                            com.liferay.portal.kernel.exception.SystemException {
1084                    getService()
1085                            .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds,
1086                            serviceContext);
1087            }
1088    
1089            /**
1090            * Updates the friendly URL of the layout.
1091            *
1092            * @param plid the primary key of the layout
1093            * @param friendlyURL the friendly URL to be assigned
1094            * @return the updated layout
1095            * @throws PortalException if a group or layout with the primary key could
1096            not be found
1097            * @throws SystemException if a system exception occurred
1098            */
1099            public static com.liferay.portal.model.Layout updateFriendlyURL(long plid,
1100                    java.lang.String friendlyURL)
1101                    throws com.liferay.portal.kernel.exception.PortalException,
1102                            com.liferay.portal.kernel.exception.SystemException {
1103                    return getService().updateFriendlyURL(plid, friendlyURL);
1104            }
1105    
1106            /**
1107            * Updates the layout.
1108            *
1109            * @param groupId the primary key of the group
1110            * @param privateLayout whether the layout is private to the group
1111            * @param layoutId the primary key of the layout
1112            * @param parentLayoutId the primary key of the layout's new parent layout
1113            * @param nameMap the locales and localized names to merge (optionally
1114            <code>null</code>)
1115            * @param titleMap the locales and localized titles to merge (optionally
1116            <code>null</code>)
1117            * @param descriptionMap the locales and localized descriptions to merge
1118            (optionally <code>null</code>)
1119            * @param keywordsMap the locales and localized keywords to merge
1120            (optionally <code>null</code>)
1121            * @param robotsMap the locales and localized robots to merge (optionally
1122            <code>null</code>)
1123            * @param type the layout's new type (optionally {@link
1124            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET})
1125            * @param hidden whether the layout is hidden
1126            * @param friendlyURL the layout's new friendly URL (optionally {@link
1127            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
1128            or {@link
1129            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}).
1130            The default values can be overridden in
1131            <code>portal-ext.properties</code> by specifying new values for
1132            the corresponding properties defined in {@link
1133            com.liferay.portal.util.PropsValues}. To see how the URL is
1134            normalized when accessed see {@link
1135            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
1136            String)}.
1137            * @param iconImage whether the icon image will be updated
1138            * @param iconBytes the byte array of the layout's new icon image
1139            * @param serviceContext the service context. Can set the modification date
1140            and expando bridge attributes for the layout. For layouts that
1141            are linked to a layout prototype, attributes named
1142            'layoutPrototypeUuid' and 'layoutPrototypeLinkedEnabled' can be
1143            specified to provide the unique identifier of the source
1144            prototype and a boolean to determined whether a link to it should
1145            be enabled to activate propagation of changes made to the linked
1146            page in the prototype.
1147            * @return the updated layout
1148            * @throws PortalException if a group or layout with the primary key could
1149            not be found, if a unique friendly URL could not be generated, if
1150            a valid parent layout ID to use could not be found, or if the
1151            layout parameters were invalid
1152            * @throws SystemException if a system exception occurred
1153            */
1154            public static com.liferay.portal.model.Layout updateLayout(long groupId,
1155                    boolean privateLayout, long layoutId, long parentLayoutId,
1156                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
1157                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1158                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1159                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
1160                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
1161                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
1162                    java.lang.Boolean iconImage, byte[] iconBytes,
1163                    com.liferay.portal.service.ServiceContext serviceContext)
1164                    throws com.liferay.portal.kernel.exception.PortalException,
1165                            com.liferay.portal.kernel.exception.SystemException {
1166                    return getService()
1167                                       .updateLayout(groupId, privateLayout, layoutId,
1168                            parentLayoutId, nameMap, titleMap, descriptionMap, keywordsMap,
1169                            robotsMap, type, hidden, friendlyURL, iconImage, iconBytes,
1170                            serviceContext);
1171            }
1172    
1173            /**
1174            * Updates the layout replacing its type settings.
1175            *
1176            * @param groupId the primary key of the group
1177            * @param privateLayout whether the layout is private to the group
1178            * @param layoutId the primary key of the layout
1179            * @param typeSettings the settings to load the unicode properties object.
1180            See {@link com.liferay.portal.kernel.util.UnicodeProperties
1181            #fastLoad(String)}.
1182            * @return the updated layout
1183            * @throws PortalException if a matching layout could not be found
1184            * @throws SystemException if a system exception occurred
1185            */
1186            public static com.liferay.portal.model.Layout updateLayout(long groupId,
1187                    boolean privateLayout, long layoutId, java.lang.String typeSettings)
1188                    throws com.liferay.portal.kernel.exception.PortalException,
1189                            com.liferay.portal.kernel.exception.SystemException {
1190                    return getService()
1191                                       .updateLayout(groupId, privateLayout, layoutId, typeSettings);
1192            }
1193    
1194            /**
1195            * Updates the look and feel of the layout.
1196            *
1197            * @param groupId the primary key of the group
1198            * @param privateLayout whether the layout is private to the group
1199            * @param layoutId the primary key of the layout
1200            * @param themeId the primary key of the layout's new theme
1201            * @param colorSchemeId the primary key of the layout's new color scheme
1202            * @param css the layout's new CSS
1203            * @param wapTheme whether the theme is for WAP browsers
1204            * @return the updated layout
1205            * @throws PortalException if a matching layout could not be found
1206            * @throws SystemException if a system exception occurred
1207            */
1208            public static com.liferay.portal.model.Layout updateLookAndFeel(
1209                    long groupId, boolean privateLayout, long layoutId,
1210                    java.lang.String themeId, java.lang.String colorSchemeId,
1211                    java.lang.String css, boolean wapTheme)
1212                    throws com.liferay.portal.kernel.exception.PortalException,
1213                            com.liferay.portal.kernel.exception.SystemException {
1214                    return getService()
1215                                       .updateLookAndFeel(groupId, privateLayout, layoutId,
1216                            themeId, colorSchemeId, css, wapTheme);
1217            }
1218    
1219            /**
1220            * Updates the name of the layout.
1221            *
1222            * @param layout the layout to be updated
1223            * @param name the layout's new name
1224            * @param languageId the primary key of the language. For more information
1225            see {@link java.util.Locale}.
1226            * @return the updated layout
1227            * @throws PortalException if the new name was <code>null</code>
1228            * @throws SystemException if a system exception occurred
1229            */
1230            public static com.liferay.portal.model.Layout updateName(
1231                    com.liferay.portal.model.Layout layout, java.lang.String name,
1232                    java.lang.String languageId)
1233                    throws com.liferay.portal.kernel.exception.PortalException,
1234                            com.liferay.portal.kernel.exception.SystemException {
1235                    return getService().updateName(layout, name, languageId);
1236            }
1237    
1238            /**
1239            * Updates the name of the layout matching the group, layout ID, and
1240            * privacy.
1241            *
1242            * @param groupId the primary key of the group
1243            * @param privateLayout whether the layout is private to the group
1244            * @param layoutId the primary key of the layout
1245            * @param name the layout's new name
1246            * @param languageId the primary key of the language. For more information
1247            see {@link java.util.Locale}.
1248            * @return the updated layout
1249            * @throws PortalException if a matching layout could not be found or if the
1250            new name was <code>null</code>
1251            * @throws SystemException if a system exception occurred
1252            */
1253            public static com.liferay.portal.model.Layout updateName(long groupId,
1254                    boolean privateLayout, long layoutId, java.lang.String name,
1255                    java.lang.String languageId)
1256                    throws com.liferay.portal.kernel.exception.PortalException,
1257                            com.liferay.portal.kernel.exception.SystemException {
1258                    return getService()
1259                                       .updateName(groupId, privateLayout, layoutId, name,
1260                            languageId);
1261            }
1262    
1263            /**
1264            * Updates the name of the layout matching the primary key.
1265            *
1266            * @param plid the primary key of the layout
1267            * @param name the name to be assigned
1268            * @param languageId the primary key of the language. For more information
1269            see {@link java.util.Locale}.
1270            * @return the updated layout
1271            * @throws PortalException if a layout with the primary key could not be
1272            found or if the name was <code>null</code>
1273            * @throws SystemException if a system exception occurred
1274            */
1275            public static com.liferay.portal.model.Layout updateName(long plid,
1276                    java.lang.String name, java.lang.String languageId)
1277                    throws com.liferay.portal.kernel.exception.PortalException,
1278                            com.liferay.portal.kernel.exception.SystemException {
1279                    return getService().updateName(plid, name, languageId);
1280            }
1281    
1282            /**
1283            * Updates the parent layout ID of the layout matching the group, layout ID,
1284            * and privacy.
1285            *
1286            * @param groupId the primary key of the group
1287            * @param privateLayout whether the layout is private to the group
1288            * @param layoutId the primary key of the layout
1289            * @param parentLayoutId the primary key to be assigned to the parent
1290            layout
1291            * @return the matching layout
1292            * @throws PortalException if a valid parent layout ID to use could not be
1293            found or if a matching layout could not be found
1294            * @throws SystemException if a system exception occurred
1295            */
1296            public static com.liferay.portal.model.Layout updateParentLayoutId(
1297                    long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
1298                    throws com.liferay.portal.kernel.exception.PortalException,
1299                            com.liferay.portal.kernel.exception.SystemException {
1300                    return getService()
1301                                       .updateParentLayoutId(groupId, privateLayout, layoutId,
1302                            parentLayoutId);
1303            }
1304    
1305            /**
1306            * Updates the parent layout ID of the layout matching the primary key. If a
1307            * layout matching the parent primary key is found, the layout ID of that
1308            * layout is assigned, otherwise {@link
1309            * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is
1310            * assigned.
1311            *
1312            * @param plid the primary key of the layout
1313            * @param parentPlid the primary key of the parent layout
1314            * @return the layout matching the primary key
1315            * @throws PortalException if a layout with the primary key could not be
1316            found or if a valid parent layout ID to use could not be found
1317            * @throws SystemException if a system exception occurred
1318            */
1319            public static com.liferay.portal.model.Layout updateParentLayoutId(
1320                    long plid, long parentPlid)
1321                    throws com.liferay.portal.kernel.exception.PortalException,
1322                            com.liferay.portal.kernel.exception.SystemException {
1323                    return getService().updateParentLayoutId(plid, parentPlid);
1324            }
1325    
1326            /**
1327            * Updates the priority of the layout.
1328            *
1329            * @param layout the layout to be updated
1330            * @param priority the layout's new priority
1331            * @return the updated layout
1332            * @throws SystemException if a system exception occurred
1333            */
1334            public static com.liferay.portal.model.Layout updatePriority(
1335                    com.liferay.portal.model.Layout layout, int priority)
1336                    throws com.liferay.portal.kernel.exception.SystemException {
1337                    return getService().updatePriority(layout, priority);
1338            }
1339    
1340            /**
1341            * Updates the priority of the layout matching the group, layout ID, and
1342            * privacy.
1343            *
1344            * @param groupId the primary key of the group
1345            * @param privateLayout whether the layout is private to the group
1346            * @param layoutId the primary key of the layout
1347            * @param priority the layout's new priority
1348            * @return the updated layout
1349            * @throws PortalException if a matching layout could not be found
1350            * @throws SystemException if a system exception occurred
1351            */
1352            public static com.liferay.portal.model.Layout updatePriority(long groupId,
1353                    boolean privateLayout, long layoutId, int priority)
1354                    throws com.liferay.portal.kernel.exception.PortalException,
1355                            com.liferay.portal.kernel.exception.SystemException {
1356                    return getService()
1357                                       .updatePriority(groupId, privateLayout, layoutId, priority);
1358            }
1359    
1360            /**
1361            * Updates the priority of the layout matching the primary key.
1362            *
1363            * @param plid the primary key of the layout
1364            * @param priority the layout's new priority
1365            * @return the updated layout
1366            * @throws PortalException if a layout with the primary key could not be
1367            found
1368            * @throws SystemException if a system exception occurred
1369            */
1370            public static com.liferay.portal.model.Layout updatePriority(long plid,
1371                    int priority)
1372                    throws com.liferay.portal.kernel.exception.PortalException,
1373                            com.liferay.portal.kernel.exception.SystemException {
1374                    return getService().updatePriority(plid, priority);
1375            }
1376    
1377            public static void updateScopedPortletNames(long groupId,
1378                    boolean privateLayout, long layoutId,
1379                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
1380                    java.util.List<java.util.Locale> nameMapModifiedLocales)
1381                    throws com.liferay.portal.kernel.exception.PortalException,
1382                            com.liferay.portal.kernel.exception.SystemException {
1383                    getService()
1384                            .updateScopedPortletNames(groupId, privateLayout, layoutId,
1385                            nameMap, nameMapModifiedLocales);
1386            }
1387    
1388            /**
1389            * Updates the names of the portlets within scope of the group, the scope of
1390            * the layout's universally unique identifier, and the privacy.
1391            *
1392            * @param groupId the primary key of the group
1393            * @param privateLayout whether the layout is private to the group
1394            * @param layoutId the primary key of the layout whose universally unique
1395            identifier to match
1396            * @param name the new name for the portlets
1397            * @param languageId the primary key of the language
1398            * @throws PortalException if a matching layout could not be found
1399            * @throws SystemException if a system exception occurred
1400            * @see com.liferay.portlet.portletconfiguration.action.EditScopeAction
1401            */
1402            public static void updateScopedPortletNames(long groupId,
1403                    boolean privateLayout, long layoutId, java.lang.String name,
1404                    java.lang.String languageId)
1405                    throws com.liferay.portal.kernel.exception.PortalException,
1406                            com.liferay.portal.kernel.exception.SystemException {
1407                    getService()
1408                            .updateScopedPortletNames(groupId, privateLayout, layoutId, name,
1409                            languageId);
1410            }
1411    
1412            public static LayoutLocalService getService() {
1413                    if (_service == null) {
1414                            _service = (LayoutLocalService)PortalBeanLocatorUtil.locate(LayoutLocalService.class.getName());
1415    
1416                            ReferenceRegistry.registerReference(LayoutLocalServiceUtil.class,
1417                                    "_service");
1418                            MethodCache.remove(LayoutLocalService.class);
1419                    }
1420    
1421                    return _service;
1422            }
1423    
1424            public void setService(LayoutLocalService service) {
1425                    MethodCache.remove(LayoutLocalService.class);
1426    
1427                    _service = service;
1428    
1429                    ReferenceRegistry.registerReference(LayoutLocalServiceUtil.class,
1430                            "_service");
1431                    MethodCache.remove(LayoutLocalService.class);
1432            }
1433    
1434            private static LayoutLocalService _service;
1435    }