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 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            public static int getLayoutsCount(com.liferay.portal.model.Group group,
876                    boolean privateLayout)
877                    throws com.liferay.portal.kernel.exception.PortalException,
878                            com.liferay.portal.kernel.exception.SystemException {
879                    return getService().getLayoutsCount(group, privateLayout);
880            }
881    
882            public static int getLayoutsCount(com.liferay.portal.model.User user,
883                    boolean privateLayout)
884                    throws com.liferay.portal.kernel.exception.PortalException,
885                            com.liferay.portal.kernel.exception.SystemException {
886                    return getService().getLayoutsCount(user, privateLayout);
887            }
888    
889            /**
890            * Returns the primary key to use for the next layout.
891            *
892            * @param groupId the primary key of the group
893            * @param privateLayout whether the layout is private to the group
894            * @return the primary key to use for the next layout
895            * @throws SystemException if a system exception occurred
896            */
897            public static long getNextLayoutId(long groupId, boolean privateLayout)
898                    throws com.liferay.portal.kernel.exception.SystemException {
899                    return getService().getNextLayoutId(groupId, privateLayout);
900            }
901    
902            /**
903            * Returns all the layouts whose friendly URLs are <code>null</code>
904            *
905            * @return all the layouts whose friendly URLs are <code>null</code>
906            * @throws SystemException if a system exception occurred
907            */
908            public static java.util.List<com.liferay.portal.model.Layout> getNullFriendlyURLLayouts()
909                    throws com.liferay.portal.kernel.exception.SystemException {
910                    return getService().getNullFriendlyURLLayouts();
911            }
912    
913            /**
914            * Returns all the layouts within scope of the group
915            *
916            * @param groupId the primary key of the group
917            * @param privateLayout whether the layout is private to the group
918            * @return the layouts within scope of the group
919            * @throws SystemException if a system exception occurred
920            */
921            public static java.util.List<com.liferay.portal.model.Layout> getScopeGroupLayouts(
922                    long groupId, boolean privateLayout)
923                    throws com.liferay.portal.kernel.exception.SystemException {
924                    return getService().getScopeGroupLayouts(groupId, privateLayout);
925            }
926    
927            public static boolean hasLayouts(com.liferay.portal.model.Group group,
928                    boolean privateLayout)
929                    throws com.liferay.portal.kernel.exception.PortalException,
930                            com.liferay.portal.kernel.exception.SystemException {
931                    return getService().hasLayouts(group, privateLayout);
932            }
933    
934            /**
935            * Returns <code>true</code> if the group has any layouts;
936            * <code>false</code> otherwise.
937            *
938            * @param groupId the primary key of the group
939            * @param privateLayout whether the layout is private to the group
940            * @param parentLayoutId the primary key of the parent layout
941            * @return <code>true</code> if the group has any layouts;
942            <code>false</code> otherwise
943            * @throws SystemException if a system exception occurred
944            */
945            public static boolean hasLayouts(long groupId, boolean privateLayout,
946                    long parentLayoutId)
947                    throws com.liferay.portal.kernel.exception.SystemException {
948                    return getService().hasLayouts(groupId, privateLayout, parentLayoutId);
949            }
950    
951            public static boolean hasLayouts(com.liferay.portal.model.User user,
952                    boolean privateLayout)
953                    throws com.liferay.portal.kernel.exception.PortalException,
954                            com.liferay.portal.kernel.exception.SystemException {
955                    return getService().hasLayouts(user, privateLayout);
956            }
957    
958            public static boolean hasLayoutSetPrototypeLayout(
959                    long layoutSetPrototypeId, java.lang.String layoutUuid)
960                    throws com.liferay.portal.kernel.exception.PortalException,
961                            com.liferay.portal.kernel.exception.SystemException {
962                    return getService()
963                                       .hasLayoutSetPrototypeLayout(layoutSetPrototypeId, layoutUuid);
964            }
965    
966            public static boolean hasLayoutSetPrototypeLayout(
967                    java.lang.String layoutSetPrototypeUuid, java.lang.String layoutUuid)
968                    throws com.liferay.portal.kernel.exception.PortalException,
969                            com.liferay.portal.kernel.exception.SystemException {
970                    return getService()
971                                       .hasLayoutSetPrototypeLayout(layoutSetPrototypeUuid,
972                            layoutUuid);
973            }
974    
975            /**
976            * Imports the layouts from the byte array.
977            *
978            * @param userId the primary key of the user
979            * @param groupId the primary key of the group
980            * @param privateLayout whether the layout is private to the group
981            * @param parameterMap the mapping of parameters indicating which
982            information will be imported. For information on the keys used in
983            the map see {@link
984            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
985            * @param bytes the byte array with the data
986            * @throws PortalException if a group or user with the primary key could not
987            be found, or if some other portal exception occurred
988            * @throws SystemException if a system exception occurred
989            * @see com.liferay.portal.lar.LayoutImporter
990            */
991            public static void importLayouts(long userId, long groupId,
992                    boolean privateLayout,
993                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
994                    byte[] bytes)
995                    throws com.liferay.portal.kernel.exception.PortalException,
996                            com.liferay.portal.kernel.exception.SystemException {
997                    getService()
998                            .importLayouts(userId, groupId, privateLayout, parameterMap, bytes);
999            }
1000    
1001            /**
1002            * Imports the layouts from the file.
1003            *
1004            * @param userId the primary key of the user
1005            * @param groupId the primary key of the group
1006            * @param privateLayout whether the layout is private to the group
1007            * @param parameterMap the mapping of parameters indicating which
1008            information will be imported. For information on the keys used in
1009            the map see {@link
1010            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1011            * @param file the LAR file with the data
1012            * @throws PortalException if a group or user with the primary key could not
1013            be found, or if some other portal exception occurred
1014            * @throws SystemException if a system exception occurred
1015            * @see com.liferay.portal.lar.LayoutImporter
1016            */
1017            public static void importLayouts(long userId, long groupId,
1018                    boolean privateLayout,
1019                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1020                    java.io.File file)
1021                    throws com.liferay.portal.kernel.exception.PortalException,
1022                            com.liferay.portal.kernel.exception.SystemException {
1023                    getService()
1024                            .importLayouts(userId, groupId, privateLayout, parameterMap, file);
1025            }
1026    
1027            /**
1028            * Imports the layouts from the input stream.
1029            *
1030            * @param userId the primary key of the user
1031            * @param groupId the primary key of the group
1032            * @param privateLayout whether the layout is private to the group
1033            * @param parameterMap the mapping of parameters indicating which
1034            information will be imported. For information on the keys used in
1035            the map see {@link
1036            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1037            * @param is the input stream
1038            * @throws PortalException if a group or user with the primary key could not
1039            be found, or if some other portal exception occurred
1040            * @throws SystemException if a system exception occurred
1041            * @see com.liferay.portal.lar.LayoutImporter
1042            */
1043            public static void importLayouts(long userId, long groupId,
1044                    boolean privateLayout,
1045                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1046                    java.io.InputStream is)
1047                    throws com.liferay.portal.kernel.exception.PortalException,
1048                            com.liferay.portal.kernel.exception.SystemException {
1049                    getService()
1050                            .importLayouts(userId, groupId, privateLayout, parameterMap, is);
1051            }
1052    
1053            /**
1054            * Imports the portlet information (categories, permissions, ... etc.) from
1055            * the file.
1056            *
1057            * @param userId the primary key of the user
1058            * @param plid the primary key of the target layout
1059            * @param groupId the primary key of the target group
1060            * @param portletId the primary key of the portlet
1061            * @param parameterMap the mapping of parameters indicating which
1062            information will be imported. For information on the keys used in
1063            the map see {@link
1064            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1065            * @param file the LAR file with the data
1066            * @throws PortalException if a group, layout, portlet or user with the
1067            primary key could not be found
1068            * @throws SystemException if a system exception occurred
1069            */
1070            public static void importPortletInfo(long userId, long plid, long groupId,
1071                    java.lang.String portletId,
1072                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1073                    java.io.File file)
1074                    throws com.liferay.portal.kernel.exception.PortalException,
1075                            com.liferay.portal.kernel.exception.SystemException {
1076                    getService()
1077                            .importPortletInfo(userId, plid, groupId, portletId, parameterMap,
1078                            file);
1079            }
1080    
1081            /**
1082            * Imports the portlet information (categories, permissions, ... etc.) from
1083            * the input stream.
1084            *
1085            * @param userId the primary key of the user
1086            * @param plid the primary key of the layout
1087            * @param groupId the primary key of the group
1088            * @param portletId the primary key of the portlet
1089            * @param parameterMap the mapping of parameters indicating which
1090            information will be imported. For information on the keys used in
1091            the map see {@link
1092            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
1093            * @param is the input stream
1094            * @throws PortalException if a group, portlet, layout or user with the
1095            primary key could not be found
1096            * @throws SystemException if a system exception occurred
1097            */
1098            public static void importPortletInfo(long userId, long plid, long groupId,
1099                    java.lang.String portletId,
1100                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
1101                    java.io.InputStream is)
1102                    throws com.liferay.portal.kernel.exception.PortalException,
1103                            com.liferay.portal.kernel.exception.SystemException {
1104                    getService()
1105                            .importPortletInfo(userId, plid, groupId, portletId, parameterMap,
1106                            is);
1107            }
1108    
1109            /**
1110            * Sets the layouts for the group, replacing and prioritizing all layouts of
1111            * the parent layout.
1112            *
1113            * @param groupId the primary key of the group
1114            * @param privateLayout whether the layout is private to the group
1115            * @param parentLayoutId the primary key of the parent layout
1116            * @param layoutIds the primary keys of the layouts
1117            * @param serviceContext the service context
1118            * @throws PortalException if a group or layout with the primary key could
1119            not be found, if no layouts were specified, if the first layout
1120            was not page-able, if the first layout was hidden, or if some
1121            other portal exception occurred
1122            * @throws SystemException if a system exception occurred
1123            */
1124            public static void setLayouts(long groupId, boolean privateLayout,
1125                    long parentLayoutId, long[] layoutIds,
1126                    com.liferay.portal.service.ServiceContext serviceContext)
1127                    throws com.liferay.portal.kernel.exception.PortalException,
1128                            com.liferay.portal.kernel.exception.SystemException {
1129                    getService()
1130                            .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds,
1131                            serviceContext);
1132            }
1133    
1134            /**
1135            * Updates the friendly URL of the layout.
1136            *
1137            * @param plid the primary key of the layout
1138            * @param friendlyURL the friendly URL to be assigned
1139            * @return the updated layout
1140            * @throws PortalException if a group or layout with the primary key could
1141            not be found
1142            * @throws SystemException if a system exception occurred
1143            */
1144            public static com.liferay.portal.model.Layout updateFriendlyURL(long plid,
1145                    java.lang.String friendlyURL)
1146                    throws com.liferay.portal.kernel.exception.PortalException,
1147                            com.liferay.portal.kernel.exception.SystemException {
1148                    return getService().updateFriendlyURL(plid, friendlyURL);
1149            }
1150    
1151            /**
1152            * Updates the layout.
1153            *
1154            * @param groupId the primary key of the group
1155            * @param privateLayout whether the layout is private to the group
1156            * @param layoutId the primary key of the layout
1157            * @param parentLayoutId the primary key of the layout's new parent layout
1158            * @param nameMap the locales and localized names to merge (optionally
1159            <code>null</code>)
1160            * @param titleMap the locales and localized titles to merge (optionally
1161            <code>null</code>)
1162            * @param descriptionMap the locales and localized descriptions to merge
1163            (optionally <code>null</code>)
1164            * @param keywordsMap the locales and localized keywords to merge
1165            (optionally <code>null</code>)
1166            * @param robotsMap the locales and localized robots to merge (optionally
1167            <code>null</code>)
1168            * @param type the layout's new type (optionally {@link
1169            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET})
1170            * @param hidden whether the layout is hidden
1171            * @param friendlyURL the layout's new friendly URL (optionally {@link
1172            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
1173            or {@link
1174            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}).
1175            The default values can be overridden in
1176            <code>portal-ext.properties</code> by specifying new values for
1177            the corresponding properties defined in {@link
1178            com.liferay.portal.util.PropsValues}. To see how the URL is
1179            normalized when accessed see {@link
1180            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
1181            String)}.
1182            * @param iconImage whether the icon image will be updated
1183            * @param iconBytes the byte array of the layout's new icon image
1184            * @param serviceContext the service context. Can set the modification date
1185            and expando bridge attributes for the layout. For layouts that
1186            are linked to a layout prototype, attributes named
1187            'layoutPrototypeUuid' and 'layoutPrototypeLinkedEnabled' can be
1188            specified to provide the unique identifier of the source
1189            prototype and a boolean to determined whether a link to it should
1190            be enabled to activate propagation of changes made to the linked
1191            page in the prototype.
1192            * @return the updated layout
1193            * @throws PortalException if a group or layout with the primary key could
1194            not be found, if a unique friendly URL could not be generated, if
1195            a valid parent layout ID to use could not be found, or if the
1196            layout parameters were invalid
1197            * @throws SystemException if a system exception occurred
1198            */
1199            public static com.liferay.portal.model.Layout updateLayout(long groupId,
1200                    boolean privateLayout, long layoutId, long parentLayoutId,
1201                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
1202                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1203                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1204                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
1205                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
1206                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
1207                    java.lang.Boolean iconImage, byte[] iconBytes,
1208                    com.liferay.portal.service.ServiceContext serviceContext)
1209                    throws com.liferay.portal.kernel.exception.PortalException,
1210                            com.liferay.portal.kernel.exception.SystemException {
1211                    return getService()
1212                                       .updateLayout(groupId, privateLayout, layoutId,
1213                            parentLayoutId, nameMap, titleMap, descriptionMap, keywordsMap,
1214                            robotsMap, type, hidden, friendlyURL, iconImage, iconBytes,
1215                            serviceContext);
1216            }
1217    
1218            /**
1219            * Updates the layout replacing its type settings.
1220            *
1221            * @param groupId the primary key of the group
1222            * @param privateLayout whether the layout is private to the group
1223            * @param layoutId the primary key of the layout
1224            * @param typeSettings the settings to load the unicode properties object.
1225            See {@link com.liferay.portal.kernel.util.UnicodeProperties
1226            #fastLoad(String)}.
1227            * @return the updated layout
1228            * @throws PortalException if a matching layout could not be found
1229            * @throws SystemException if a system exception occurred
1230            */
1231            public static com.liferay.portal.model.Layout updateLayout(long groupId,
1232                    boolean privateLayout, long layoutId, java.lang.String typeSettings)
1233                    throws com.liferay.portal.kernel.exception.PortalException,
1234                            com.liferay.portal.kernel.exception.SystemException {
1235                    return getService()
1236                                       .updateLayout(groupId, privateLayout, layoutId, typeSettings);
1237            }
1238    
1239            /**
1240            * Updates the look and feel of the layout.
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 themeId the primary key of the layout's new theme
1246            * @param colorSchemeId the primary key of the layout's new color scheme
1247            * @param css the layout's new CSS
1248            * @param wapTheme whether the theme is for WAP browsers
1249            * @return the updated layout
1250            * @throws PortalException if a matching layout could not be found
1251            * @throws SystemException if a system exception occurred
1252            */
1253            public static com.liferay.portal.model.Layout updateLookAndFeel(
1254                    long groupId, boolean privateLayout, long layoutId,
1255                    java.lang.String themeId, java.lang.String colorSchemeId,
1256                    java.lang.String css, boolean wapTheme)
1257                    throws com.liferay.portal.kernel.exception.PortalException,
1258                            com.liferay.portal.kernel.exception.SystemException {
1259                    return getService()
1260                                       .updateLookAndFeel(groupId, privateLayout, layoutId,
1261                            themeId, colorSchemeId, css, wapTheme);
1262            }
1263    
1264            /**
1265            * Updates the name of the layout.
1266            *
1267            * @param layout the layout to be updated
1268            * @param name the layout's new name
1269            * @param languageId the primary key of the language. For more information
1270            see {@link java.util.Locale}.
1271            * @return the updated layout
1272            * @throws PortalException if the new name was <code>null</code>
1273            * @throws SystemException if a system exception occurred
1274            */
1275            public static com.liferay.portal.model.Layout updateName(
1276                    com.liferay.portal.model.Layout layout, java.lang.String name,
1277                    java.lang.String languageId)
1278                    throws com.liferay.portal.kernel.exception.PortalException,
1279                            com.liferay.portal.kernel.exception.SystemException {
1280                    return getService().updateName(layout, name, languageId);
1281            }
1282    
1283            /**
1284            * Updates the name of the layout matching the group, layout ID, and
1285            * privacy.
1286            *
1287            * @param groupId the primary key of the group
1288            * @param privateLayout whether the layout is private to the group
1289            * @param layoutId the primary key of the layout
1290            * @param name the layout's new name
1291            * @param languageId the primary key of the language. For more information
1292            see {@link java.util.Locale}.
1293            * @return the updated layout
1294            * @throws PortalException if a matching layout could not be found or if the
1295            new name was <code>null</code>
1296            * @throws SystemException if a system exception occurred
1297            */
1298            public static com.liferay.portal.model.Layout updateName(long groupId,
1299                    boolean privateLayout, long layoutId, java.lang.String name,
1300                    java.lang.String languageId)
1301                    throws com.liferay.portal.kernel.exception.PortalException,
1302                            com.liferay.portal.kernel.exception.SystemException {
1303                    return getService()
1304                                       .updateName(groupId, privateLayout, layoutId, name,
1305                            languageId);
1306            }
1307    
1308            /**
1309            * Updates the name of the layout matching the primary key.
1310            *
1311            * @param plid the primary key of the layout
1312            * @param name the name to be assigned
1313            * @param languageId the primary key of the language. For more information
1314            see {@link java.util.Locale}.
1315            * @return the updated layout
1316            * @throws PortalException if a layout with the primary key could not be
1317            found or if the name was <code>null</code>
1318            * @throws SystemException if a system exception occurred
1319            */
1320            public static com.liferay.portal.model.Layout updateName(long plid,
1321                    java.lang.String name, java.lang.String languageId)
1322                    throws com.liferay.portal.kernel.exception.PortalException,
1323                            com.liferay.portal.kernel.exception.SystemException {
1324                    return getService().updateName(plid, name, languageId);
1325            }
1326    
1327            /**
1328            * Updates the parent layout ID of the layout matching the group, layout ID,
1329            * and privacy.
1330            *
1331            * @param groupId the primary key of the group
1332            * @param privateLayout whether the layout is private to the group
1333            * @param layoutId the primary key of the layout
1334            * @param parentLayoutId the primary key to be assigned to the parent
1335            layout
1336            * @return the matching layout
1337            * @throws PortalException if a valid parent layout ID to use could not be
1338            found or if a matching layout could not be found
1339            * @throws SystemException if a system exception occurred
1340            */
1341            public static com.liferay.portal.model.Layout updateParentLayoutId(
1342                    long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
1343                    throws com.liferay.portal.kernel.exception.PortalException,
1344                            com.liferay.portal.kernel.exception.SystemException {
1345                    return getService()
1346                                       .updateParentLayoutId(groupId, privateLayout, layoutId,
1347                            parentLayoutId);
1348            }
1349    
1350            /**
1351            * Updates the parent layout ID of the layout matching the primary key. If a
1352            * layout matching the parent primary key is found, the layout ID of that
1353            * layout is assigned, otherwise {@link
1354            * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is
1355            * assigned.
1356            *
1357            * @param plid the primary key of the layout
1358            * @param parentPlid the primary key of the parent layout
1359            * @return the layout matching the primary key
1360            * @throws PortalException if a layout with the primary key could not be
1361            found or if a valid parent layout ID to use could not be found
1362            * @throws SystemException if a system exception occurred
1363            */
1364            public static com.liferay.portal.model.Layout updateParentLayoutId(
1365                    long plid, long parentPlid)
1366                    throws com.liferay.portal.kernel.exception.PortalException,
1367                            com.liferay.portal.kernel.exception.SystemException {
1368                    return getService().updateParentLayoutId(plid, parentPlid);
1369            }
1370    
1371            /**
1372            * Updates the priority of the layout.
1373            *
1374            * @param layout the layout to be updated
1375            * @param priority the layout's new priority
1376            * @return the updated layout
1377            * @throws SystemException if a system exception occurred
1378            */
1379            public static com.liferay.portal.model.Layout updatePriority(
1380                    com.liferay.portal.model.Layout layout, int priority)
1381                    throws com.liferay.portal.kernel.exception.SystemException {
1382                    return getService().updatePriority(layout, priority);
1383            }
1384    
1385            /**
1386            * Updates the priority of the layout matching the group, layout ID, and
1387            * privacy.
1388            *
1389            * @param groupId the primary key of the group
1390            * @param privateLayout whether the layout is private to the group
1391            * @param layoutId the primary key of the layout
1392            * @param priority the layout's new priority
1393            * @return the updated layout
1394            * @throws PortalException if a matching layout could not be found
1395            * @throws SystemException if a system exception occurred
1396            */
1397            public static com.liferay.portal.model.Layout updatePriority(long groupId,
1398                    boolean privateLayout, long layoutId, int priority)
1399                    throws com.liferay.portal.kernel.exception.PortalException,
1400                            com.liferay.portal.kernel.exception.SystemException {
1401                    return getService()
1402                                       .updatePriority(groupId, privateLayout, layoutId, priority);
1403            }
1404    
1405            /**
1406            * Updates the priority of the layout matching the primary key.
1407            *
1408            * @param plid the primary key of the layout
1409            * @param priority the layout's new priority
1410            * @return the updated layout
1411            * @throws PortalException if a layout with the primary key could not be
1412            found
1413            * @throws SystemException if a system exception occurred
1414            */
1415            public static com.liferay.portal.model.Layout updatePriority(long plid,
1416                    int priority)
1417                    throws com.liferay.portal.kernel.exception.PortalException,
1418                            com.liferay.portal.kernel.exception.SystemException {
1419                    return getService().updatePriority(plid, priority);
1420            }
1421    
1422            public static void updateScopedPortletNames(long groupId,
1423                    boolean privateLayout, long layoutId,
1424                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
1425                    java.util.List<java.util.Locale> nameMapModifiedLocales)
1426                    throws com.liferay.portal.kernel.exception.PortalException,
1427                            com.liferay.portal.kernel.exception.SystemException {
1428                    getService()
1429                            .updateScopedPortletNames(groupId, privateLayout, layoutId,
1430                            nameMap, nameMapModifiedLocales);
1431            }
1432    
1433            /**
1434            * Updates the names of the portlets within scope of the group, the scope of
1435            * the layout's universally unique identifier, and the privacy.
1436            *
1437            * @param groupId the primary key of the group
1438            * @param privateLayout whether the layout is private to the group
1439            * @param layoutId the primary key of the layout whose universally unique
1440            identifier to match
1441            * @param name the new name for the portlets
1442            * @param languageId the primary key of the language
1443            * @throws PortalException if a matching layout could not be found
1444            * @throws SystemException if a system exception occurred
1445            * @see com.liferay.portlet.portletconfiguration.action.EditScopeAction
1446            */
1447            public static void updateScopedPortletNames(long groupId,
1448                    boolean privateLayout, long layoutId, java.lang.String name,
1449                    java.lang.String languageId)
1450                    throws com.liferay.portal.kernel.exception.PortalException,
1451                            com.liferay.portal.kernel.exception.SystemException {
1452                    getService()
1453                            .updateScopedPortletNames(groupId, privateLayout, layoutId, name,
1454                            languageId);
1455            }
1456    
1457            public static LayoutLocalService getService() {
1458                    if (_service == null) {
1459                            _service = (LayoutLocalService)PortalBeanLocatorUtil.locate(LayoutLocalService.class.getName());
1460    
1461                            ReferenceRegistry.registerReference(LayoutLocalServiceUtil.class,
1462                                    "_service");
1463                            MethodCache.remove(LayoutLocalService.class);
1464                    }
1465    
1466                    return _service;
1467            }
1468    
1469            public void setService(LayoutLocalService service) {
1470                    MethodCache.remove(LayoutLocalService.class);
1471    
1472                    _service = service;
1473    
1474                    ReferenceRegistry.registerReference(LayoutLocalServiceUtil.class,
1475                            "_service");
1476                    MethodCache.remove(LayoutLocalService.class);
1477            }
1478    
1479            private static LayoutLocalService _service;
1480    }