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