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 remote service. This utility wraps {@link com.liferay.portal.service.impl.LayoutServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
022     *
023     * <p>
024     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see LayoutService
029     * @see com.liferay.portal.service.base.LayoutServiceBaseImpl
030     * @see com.liferay.portal.service.impl.LayoutServiceImpl
031     * @generated
032     */
033    public class LayoutServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            /**
059            * Adds a layout with additional parameters.
060            *
061            * <p>
062            * This method handles the creation of the layout including its resources,
063            * metadata, and internal data structures. It is not necessary to make
064            * subsequent calls to any methods to setup default groups, resources, ...
065            * etc.
066            * </p>
067            *
068            * @param groupId the primary key of the group
069            * @param privateLayout whether the layout is private to the group
070            * @param parentLayoutId the primary key of the parent layout (optionally
071            {@link
072            com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID})
073            * @param localeNamesMap the layout's locales and localized names
074            * @param localeTitlesMap the layout's locales and localized titles
075            * @param descriptionMap the layout's locales and localized descriptions
076            * @param keywordsMap the layout's locales and localized keywords
077            * @param robotsMap the layout's locales and localized robots
078            * @param type the layout's type (optionally {@link
079            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The
080            possible types can be found in {@link
081            com.liferay.portal.model.LayoutConstants}.
082            * @param hidden whether the layout is hidden
083            * @param friendlyURL the layout's friendly URL (optionally {@link
084            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
085            or {@link
086            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}).
087            The default values can be overridden in
088            <code>portal-ext.properties</code> by specifying new values for
089            the corresponding properties defined in {@link
090            com.liferay.portal.util.PropsValues}. To see how the URL is
091            normalized when accessed see {@link
092            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
093            String)}.
094            * @param serviceContext the service context to be applied. Must set the
095            UUID for the layout. Can set the creation date, modification date
096            and the expando bridge attributes for the layout. For layouts
097            that belong to a layout set prototype, an attribute named
098            'layoutUpdateable' can be used to specify whether site
099            administrators can modify this page within their site.
100            * @return the layout
101            * @throws PortalException if a group with the primary key could not be
102            found, if the group did not have permission to manage the layouts
103            involved, or if layout values were invalid
104            * @throws SystemException if a system exception occurred
105            */
106            public static com.liferay.portal.model.Layout addLayout(long groupId,
107                    boolean privateLayout, long parentLayoutId,
108                    java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
109                    java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
110                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
111                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
112                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
113                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
114                    com.liferay.portal.service.ServiceContext serviceContext)
115                    throws com.liferay.portal.kernel.exception.PortalException,
116                            com.liferay.portal.kernel.exception.SystemException {
117                    return getService()
118                                       .addLayout(groupId, privateLayout, parentLayoutId,
119                            localeNamesMap, localeTitlesMap, descriptionMap, keywordsMap,
120                            robotsMap, type, hidden, friendlyURL, serviceContext);
121            }
122    
123            /**
124            * Adds a layout with single entry maps for name, title, and description to
125            * the default locale.
126            *
127            * <p>
128            * This method handles the creation of the layout including its resources,
129            * metadata, and internal data structures. It is not necessary to make
130            * subsequent calls to any methods to setup default groups, resources, ...
131            * etc.
132            * </p>
133            *
134            * @param groupId the primary key of the group
135            * @param privateLayout whether the layout is private to the group
136            * @param parentLayoutId the primary key of the parent layout (optionally
137            {@link
138            com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID})
139            * @param name Map the layout's locales and localized names
140            * @param title Map the layout's locales and localized titles
141            * @param description Map the layout's locales and localized descriptions
142            * @param type the layout's type (optionally {@link
143            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The
144            possible types can be found in {@link
145            com.liferay.portal.model.LayoutConstants}.
146            * @param hidden whether the layout is hidden
147            * @param friendlyURL the layout's friendly URL (optionally {@link
148            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
149            or {@link
150            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}).
151            The default values can be overridden in
152            <code>portal-ext.properties</code> by specifying new values for
153            the corresponding properties defined in {@link
154            com.liferay.portal.util.PropsValues}. To see how the URL is
155            normalized when accessed see {@link
156            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
157            String)}.
158            * @param serviceContext the service context to be applied. Must set the
159            UUID for the layout. Can specify the creation date, modification
160            date and the expando bridge attributes for the layout. For
161            layouts that belong to a layout set prototype, an attribute named
162            'layoutUpdateable' can be used to specify whether site
163            administrators can modify this page within their site.
164            * @return the layout
165            * @throws PortalException if a group with the primary key could not be
166            found, if the group did not have permission to manage the layouts
167            involved, or if layout values were invalid
168            * @throws SystemException if a system exception occurred
169            */
170            public static com.liferay.portal.model.Layout addLayout(long groupId,
171                    boolean privateLayout, long parentLayoutId, java.lang.String name,
172                    java.lang.String title, java.lang.String description,
173                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
174                    com.liferay.portal.service.ServiceContext serviceContext)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getService()
178                                       .addLayout(groupId, privateLayout, parentLayoutId, name,
179                            title, description, type, hidden, friendlyURL, serviceContext);
180            }
181    
182            /**
183            * Deletes the layout with the primary key, also deleting the layout's child
184            * layouts, and associated resources.
185            *
186            * @param groupId the primary key of the group
187            * @param privateLayout whether the layout is private to the group
188            * @param layoutId the primary key of the layout
189            * @param serviceContext the service context to be applied
190            * @throws PortalException if the user did not have permission to delete the
191            layout, if a matching layout could not be found , or if some
192            other portal exception occurred
193            * @throws SystemException if a system exception occurred
194            */
195            public static void deleteLayout(long groupId, boolean privateLayout,
196                    long layoutId, com.liferay.portal.service.ServiceContext serviceContext)
197                    throws com.liferay.portal.kernel.exception.PortalException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    getService()
200                            .deleteLayout(groupId, privateLayout, layoutId, serviceContext);
201            }
202    
203            /**
204            * Deletes the layout with the plid, also deleting the layout's child
205            * layouts, and associated resources.
206            *
207            * @param plid the primary key of the layout
208            * @param serviceContext the service context to be applied
209            * @throws PortalException if the user did not have permission to delete the
210            layout, if a layout with the primary key could not be found , or
211            if some other portal exception occurred
212            * @throws SystemException if a system exception occurred
213            */
214            public static void deleteLayout(long plid,
215                    com.liferay.portal.service.ServiceContext serviceContext)
216                    throws com.liferay.portal.kernel.exception.PortalException,
217                            com.liferay.portal.kernel.exception.SystemException {
218                    getService().deleteLayout(plid, serviceContext);
219            }
220    
221            /**
222            * Exports the layouts that match the primary keys and the criteria as a
223            * byte array.
224            *
225            * @param groupId the primary key of the group
226            * @param privateLayout whether the layout is private to the group
227            * @param layoutIds the primary keys of the layouts to be exported
228            * @param parameterMap the mapping of parameters indicating which
229            information to export. For information on the keys used in the
230            map see {@link
231            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
232            * @param startDate the export's start date
233            * @param endDate the export's end date
234            * @return the layouts as a byte array
235            * @throws PortalException if a group or any layout with the primary key
236            could not be found, if the group did not have permission to
237            manage the layouts, or if some other portal exception occurred
238            * @throws SystemException if a system exception occurred
239            */
240            public static byte[] exportLayouts(long groupId, boolean privateLayout,
241                    long[] layoutIds,
242                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
243                    java.util.Date startDate, java.util.Date endDate)
244                    throws com.liferay.portal.kernel.exception.PortalException,
245                            com.liferay.portal.kernel.exception.SystemException {
246                    return getService()
247                                       .exportLayouts(groupId, privateLayout, layoutIds,
248                            parameterMap, startDate, endDate);
249            }
250    
251            /**
252            * Exports all layouts that match the criteria as a byte array.
253            *
254            * @param groupId the primary key of the group
255            * @param privateLayout whether the layout is private to the group
256            * @param parameterMap the mapping of parameters indicating which
257            information to export. For information on the keys used in the
258            map see {@link
259            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
260            * @param startDate the export's start date
261            * @param endDate the export's end date
262            * @return the layout as a byte array
263            * @throws PortalException if a group with the primary key could not be
264            found, if the group did not have permission to manage the
265            layouts, or if some other portal exception occurred
266            * @throws SystemException if a system exception occurred
267            */
268            public static byte[] exportLayouts(long groupId, boolean privateLayout,
269                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
270                    java.util.Date startDate, java.util.Date endDate)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException {
273                    return getService()
274                                       .exportLayouts(groupId, privateLayout, parameterMap,
275                            startDate, endDate);
276            }
277    
278            /**
279            * Exports all layouts that match the primary keys and criteria as a file.
280            *
281            * @param groupId the primary key of the group
282            * @param privateLayout whether the layout is private to the group
283            * @param layoutIds the primary keys of the layouts to be exported
284            (optionally <code>null</code>)
285            * @param parameterMap the mapping of parameters indicating which
286            information to export. For information on the keys used in the
287            map see {@link
288            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
289            * @param startDate the export's start date
290            * @param endDate the export's end date
291            * @return the layouts as a File
292            * @throws PortalException if a group or any layout with the primary key
293            could not be found, it the group did not have permission to
294            manage the layouts, or if some other portal exception occurred
295            * @throws SystemException if a system exception occurred
296            */
297            public static java.io.File exportLayoutsAsFile(long groupId,
298                    boolean privateLayout, long[] layoutIds,
299                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
300                    java.util.Date startDate, java.util.Date endDate)
301                    throws com.liferay.portal.kernel.exception.PortalException,
302                            com.liferay.portal.kernel.exception.SystemException {
303                    return getService()
304                                       .exportLayoutsAsFile(groupId, privateLayout, layoutIds,
305                            parameterMap, startDate, endDate);
306            }
307    
308            /**
309            * Exports the portlet information (categories, permissions, ... etc.) as a
310            * byte array.
311            *
312            * @param plid the primary key of the layout
313            * @param groupId the primary key of the group
314            * @param portletId the primary key of the portlet
315            * @param parameterMap the mapping of parameters indicating which
316            information to export. For information on the keys used in the
317            map see {@link
318            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
319            * @param startDate the export's start date
320            * @param endDate the export's end date
321            * @return the portlet information as a byte array
322            * @throws PortalException if a layout, group, or portlet with the primary
323            key could not be found, if the group did not have permission to
324            manage the layouts involved, or if some other portal exception
325            occurred
326            * @throws SystemException if a system exception occurred
327            */
328            public static byte[] exportPortletInfo(long plid, long groupId,
329                    java.lang.String portletId,
330                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
331                    java.util.Date startDate, java.util.Date endDate)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    return getService()
335                                       .exportPortletInfo(plid, groupId, portletId, parameterMap,
336                            startDate, endDate);
337            }
338    
339            /**
340            * Exports the portlet information (categories, permissions, ... etc.) as a
341            * file.
342            *
343            * @param plid the primary key of the layout
344            * @param groupId the primary key of the group
345            * @param portletId the primary key of the portlet
346            * @param parameterMap the mapping of parameters indicating which
347            information to export. For information on the keys used in the
348            map see {@link
349            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
350            * @param startDate the export's start date
351            * @param endDate the export's end date
352            * @return the portlet information as a file
353            * @throws PortalException if a layout, group, or portlet with the primary
354            key could not be found, it the group did not have permission to
355            manage the layouts involved, or if some other portal exception
356            occurred
357            * @throws SystemException if a system exception occurred
358            */
359            public static java.io.File exportPortletInfoAsFile(long plid, long groupId,
360                    java.lang.String portletId,
361                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
362                    java.util.Date startDate, java.util.Date endDate)
363                    throws com.liferay.portal.kernel.exception.PortalException,
364                            com.liferay.portal.kernel.exception.SystemException {
365                    return getService()
366                                       .exportPortletInfoAsFile(plid, groupId, portletId,
367                            parameterMap, startDate, endDate);
368            }
369    
370            /**
371            * Returns all the ancestor layouts of the layout.
372            *
373            * @param plid the primary key of the layout
374            * @return the ancestor layouts of the layout
375            * @throws PortalException if a matching layout could not be found or if a
376            portal exception occurred
377            * @throws SystemException if a system exception occurred
378            */
379            public static java.util.List<com.liferay.portal.model.Layout> getAncestorLayouts(
380                    long plid)
381                    throws com.liferay.portal.kernel.exception.PortalException,
382                            com.liferay.portal.kernel.exception.SystemException {
383                    return getService().getAncestorLayouts(plid);
384            }
385    
386            /**
387            * Returns the primary key of the default layout for the group.
388            *
389            * @param groupId the primary key of the group
390            * @param scopeGroupId the primary key of the scope group. See {@link
391            com.liferay.portal.service.ServiceContext#getScopeGroupId()}.
392            * @param privateLayout whether the layout is private to the group
393            * @param portletId the primary key of the portlet
394            * @return Returns the primary key of the default layout group; {@link
395            com.liferay.portal.model.LayoutConstants#DEFAULT_PLID} otherwise
396            * @throws PortalException if a group, layout, or portlet with the primary
397            key could not be found
398            * @throws SystemException if a system exception occurred
399            */
400            public static long getDefaultPlid(long groupId, long scopeGroupId,
401                    boolean privateLayout, java.lang.String portletId)
402                    throws com.liferay.portal.kernel.exception.PortalException,
403                            com.liferay.portal.kernel.exception.SystemException {
404                    return getService()
405                                       .getDefaultPlid(groupId, scopeGroupId, privateLayout,
406                            portletId);
407            }
408    
409            public static long getDefaultPlid(long groupId, long scopeGroupId,
410                    java.lang.String portletId)
411                    throws com.liferay.portal.kernel.exception.PortalException,
412                            com.liferay.portal.kernel.exception.SystemException {
413                    return getService().getDefaultPlid(groupId, scopeGroupId, portletId);
414            }
415    
416            /**
417            * Returns the layout matching the UUID, group, and privacy.
418            *
419            * @param uuid the layout's UUID
420            * @param groupId the primary key of the group
421            * @param privateLayout whether the layout is private to the group
422            * @return the matching layout
423            * @throws PortalException if a matching layout could not be found, if the
424            user did not have permission to view the layout, or if some other
425            portal exception occurred
426            * @throws SystemException if a system exception occurred
427            */
428            public static com.liferay.portal.model.Layout getLayoutByUuidAndGroupId(
429                    java.lang.String uuid, long groupId, boolean privateLayout)
430                    throws com.liferay.portal.kernel.exception.PortalException,
431                            com.liferay.portal.kernel.exception.SystemException {
432                    return getService()
433                                       .getLayoutByUuidAndGroupId(uuid, groupId, privateLayout);
434            }
435    
436            /**
437            * Returns the name of the layout.
438            *
439            * @param groupId the primary key of the group
440            * @param privateLayout whether the layout is private to the group
441            * @param layoutId the primary key of the layout
442            * @param languageId the primary key of the language. For more information
443            See {@link java.util.Locale}.
444            * @return the layout's name
445            * @throws PortalException if a matching layout could not be found
446            * @throws SystemException if a system exception occurred
447            */
448            public static java.lang.String getLayoutName(long groupId,
449                    boolean privateLayout, long layoutId, java.lang.String languageId)
450                    throws com.liferay.portal.kernel.exception.PortalException,
451                            com.liferay.portal.kernel.exception.SystemException {
452                    return getService()
453                                       .getLayoutName(groupId, privateLayout, layoutId, languageId);
454            }
455    
456            /**
457            * Returns the layout references for all the layouts that belong to the
458            * company and belong to the portlet that matches the preferences.
459            *
460            * @param companyId the primary key of the company
461            * @param portletId the primary key of the portlet
462            * @param preferencesKey the portlet's preference key
463            * @param preferencesValue the portlet's preference value
464            * @return the layout references of the matching layouts
465            * @throws SystemException if a system exception occurred
466            */
467            public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
468                    long companyId, java.lang.String portletId,
469                    java.lang.String preferencesKey, java.lang.String preferencesValue)
470                    throws com.liferay.portal.kernel.exception.SystemException {
471                    return getService()
472                                       .getLayoutReferences(companyId, portletId, preferencesKey,
473                            preferencesValue);
474            }
475    
476            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
477                    long groupId, boolean privateLayout)
478                    throws com.liferay.portal.kernel.exception.SystemException {
479                    return getService().getLayouts(groupId, privateLayout);
480            }
481    
482            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
483                    long groupId, boolean privateLayout, long parentLayoutId)
484                    throws com.liferay.portal.kernel.exception.SystemException {
485                    return getService().getLayouts(groupId, privateLayout, parentLayoutId);
486            }
487    
488            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
489                    long groupId, boolean privateLayout, long parentLayoutId,
490                    boolean incomplete, int start, int end)
491                    throws com.liferay.portal.kernel.exception.PortalException,
492                            com.liferay.portal.kernel.exception.SystemException {
493                    return getService()
494                                       .getLayouts(groupId, privateLayout, parentLayoutId,
495                            incomplete, start, end);
496            }
497    
498            /**
499            * Imports the layouts from the byte array.
500            *
501            * @param groupId the primary key of the group
502            * @param privateLayout whether the layout is private to the group
503            * @param parameterMap the mapping of parameters indicating which
504            information will be imported. For information on the keys used in
505            the map see {@link
506            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
507            * @param bytes the byte array with the data
508            * @throws PortalException if a group with the primary key could not be
509            found, if the group did not have permission to manage the
510            layouts, or if some other portal exception occurred
511            * @throws SystemException if a system exception occurred
512            * @see com.liferay.portal.lar.LayoutImporter
513            */
514            public static void importLayouts(long groupId, boolean privateLayout,
515                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
516                    byte[] bytes)
517                    throws com.liferay.portal.kernel.exception.PortalException,
518                            com.liferay.portal.kernel.exception.SystemException {
519                    getService().importLayouts(groupId, privateLayout, parameterMap, bytes);
520            }
521    
522            /**
523            * Imports the layouts from the file.
524            *
525            * @param groupId the primary key of the group
526            * @param privateLayout whether the layout is private to the group
527            * @param parameterMap the mapping of parameters indicating which
528            information will be imported. For information on the keys used in
529            the map see {@link
530            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
531            * @param file the LAR file with the data
532            * @throws PortalException if a group with the primary key could not be
533            found, if the group did not have permission to manage the layouts
534            and publish, or if some other portal exception occurred
535            * @throws SystemException if a system exception occurred
536            * @see com.liferay.portal.lar.LayoutImporter
537            */
538            public static void importLayouts(long groupId, boolean privateLayout,
539                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
540                    java.io.File file)
541                    throws com.liferay.portal.kernel.exception.PortalException,
542                            com.liferay.portal.kernel.exception.SystemException {
543                    getService().importLayouts(groupId, privateLayout, parameterMap, file);
544            }
545    
546            /**
547            * Imports the layouts from the input stream.
548            *
549            * @param groupId the primary key of the group
550            * @param privateLayout whether the layout is private to the group
551            * @param parameterMap the mapping of parameters indicating which
552            information will be imported. For information on the keys used in
553            the map see {@link
554            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
555            * @param is the input stream
556            * @throws PortalException if a group with the primary key could not be
557            found, if the group did not have permission to manage the
558            layouts, or if some other portal exception occurred
559            * @throws SystemException if a system exception occurred
560            * @see com.liferay.portal.lar.LayoutImporter
561            */
562            public static void importLayouts(long groupId, boolean privateLayout,
563                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
564                    java.io.InputStream is)
565                    throws com.liferay.portal.kernel.exception.PortalException,
566                            com.liferay.portal.kernel.exception.SystemException {
567                    getService().importLayouts(groupId, privateLayout, parameterMap, is);
568            }
569    
570            /**
571            * Imports the portlet information (categories, permissions, ... etc.) from
572            * the file.
573            *
574            * @param plid the primary key of the layout
575            * @param groupId the primary key of the group
576            * @param portletId the primary key of the portlet
577            * @param parameterMap the mapping of parameters indicating which
578            information will be imported. For information on the keys used in
579            the map see {@link
580            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
581            * @param file the LAR file with the data
582            * @throws PortalException if a group, layout, or portlet with the primary
583            key could not be found, or if the group did not have permission
584            to manage the layouts
585            * @throws SystemException if a system exception occurred
586            */
587            public static void importPortletInfo(long plid, long groupId,
588                    java.lang.String portletId,
589                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
590                    java.io.File file)
591                    throws com.liferay.portal.kernel.exception.PortalException,
592                            com.liferay.portal.kernel.exception.SystemException {
593                    getService()
594                            .importPortletInfo(plid, groupId, portletId, parameterMap, file);
595            }
596    
597            /**
598            * Imports the portlet information (categories, permissions, ... etc.) from
599            * the input stream.
600            *
601            * @param plid the primary key of the layout
602            * @param groupId the primary key of the group
603            * @param portletId the primary key of the portlet
604            * @param parameterMap the mapping of parameters indicating which
605            information will be imported. For information on the keys used in
606            the map see {@link
607            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
608            * @param is the input stream
609            * @throws PortalException if a group, portlet, or layout with the primary
610            key could not be found or if the group did not have permission to
611            manage the layouts
612            * @throws SystemException if a system exception occurred
613            */
614            public static void importPortletInfo(long plid, long groupId,
615                    java.lang.String portletId,
616                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
617                    java.io.InputStream is)
618                    throws com.liferay.portal.kernel.exception.PortalException,
619                            com.liferay.portal.kernel.exception.SystemException {
620                    getService()
621                            .importPortletInfo(plid, groupId, portletId, parameterMap, is);
622            }
623    
624            /**
625            * Schedules a range of layouts to be published.
626            *
627            * @param sourceGroupId the primary key of the source group
628            * @param targetGroupId the primary key of the target group
629            * @param privateLayout whether the layout is private to the group
630            * @param layoutIdMap the layouts considered for publishing, specified by
631            the layout IDs and booleans indicating whether they have children
632            * @param parameterMap the mapping of parameters indicating which
633            information will be used. See {@link
634            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}
635            * @param scope the scope of the pages. It can be <code>all-pages</code> or
636            <code>selected-pages</code>.
637            * @param startDate the start date
638            * @param endDate the end date
639            * @param groupName the group name (optionally {@link
640            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
641            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
642            * @param cronText the cron text. See {@link
643            com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText}
644            * @param schedulerStartDate the scheduler start date
645            * @param schedulerEndDate the scheduler end date
646            * @param description the scheduler description
647            * @throws PortalException if the group did not have permission to manage
648            and publish
649            * @throws SystemException if a system exception occurred
650            */
651            public static void schedulePublishToLive(long sourceGroupId,
652                    long targetGroupId, boolean privateLayout,
653                    java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
654                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
655                    java.lang.String scope, java.util.Date startDate,
656                    java.util.Date endDate, java.lang.String groupName,
657                    java.lang.String cronText, java.util.Date schedulerStartDate,
658                    java.util.Date schedulerEndDate, java.lang.String description)
659                    throws com.liferay.portal.kernel.exception.PortalException,
660                            com.liferay.portal.kernel.exception.SystemException {
661                    getService()
662                            .schedulePublishToLive(sourceGroupId, targetGroupId, privateLayout,
663                            layoutIdMap, parameterMap, scope, startDate, endDate, groupName,
664                            cronText, schedulerStartDate, schedulerEndDate, description);
665            }
666    
667            /**
668            * Schedules a range of layouts to be stored.
669            *
670            * @param sourceGroupId the primary key of the source group
671            * @param privateLayout whether the layout is private to the group
672            * @param layoutIdMap the layouts considered for publishing, specified by
673            the layout IDs and booleans indicating whether they have children
674            * @param parameterMap the mapping of parameters indicating which
675            information will be used. See {@link
676            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}
677            * @param remoteAddress the remote address
678            * @param remotePort the remote port
679            * @param remotePathContext the remote path context
680            * @param secureConnection whether the connection is secure
681            * @param remoteGroupId the primary key of the remote group
682            * @param remotePrivateLayout whether remote group's layout is private
683            * @param startDate the start date
684            * @param endDate the end date
685            * @param groupName the group name. Optionally {@link
686            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
687            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
688            * @param cronText the cron text. See {@link
689            com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText}
690            * @param schedulerStartDate the scheduler start date
691            * @param schedulerEndDate the scheduler end date
692            * @param description the scheduler description
693            * @throws PortalException if a group with the source group primary key was
694            not found or if the group did not have permission to publish
695            * @throws SystemException if a system exception occurred
696            */
697            public static void schedulePublishToRemote(long sourceGroupId,
698                    boolean privateLayout,
699                    java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
700                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
701                    java.lang.String remoteAddress, int remotePort,
702                    java.lang.String remotePathContext, boolean secureConnection,
703                    long remoteGroupId, boolean remotePrivateLayout,
704                    java.util.Date startDate, java.util.Date endDate,
705                    java.lang.String groupName, java.lang.String cronText,
706                    java.util.Date schedulerStartDate, java.util.Date schedulerEndDate,
707                    java.lang.String description)
708                    throws com.liferay.portal.kernel.exception.PortalException,
709                            com.liferay.portal.kernel.exception.SystemException {
710                    getService()
711                            .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap,
712                            parameterMap, remoteAddress, remotePort, remotePathContext,
713                            secureConnection, remoteGroupId, remotePrivateLayout, startDate,
714                            endDate, groupName, cronText, schedulerStartDate, schedulerEndDate,
715                            description);
716            }
717    
718            /**
719            * Sets the layouts for the group, replacing and prioritizing all layouts of
720            * the parent layout.
721            *
722            * @param groupId the primary key of the group
723            * @param privateLayout whether the layout is private to the group
724            * @param parentLayoutId the primary key of the parent layout
725            * @param layoutIds the primary keys of the layouts
726            * @param serviceContext the service context to be applied
727            * @throws PortalException if a group or layout with the primary key could
728            not be found, if the group did not have permission to manage the
729            layouts, if no layouts were specified, if the first layout was
730            not page-able, if the first layout was hidden, or if some other
731            portal exception occurred
732            * @throws SystemException if a system exception occurred
733            */
734            public static void setLayouts(long groupId, boolean privateLayout,
735                    long parentLayoutId, long[] layoutIds,
736                    com.liferay.portal.service.ServiceContext serviceContext)
737                    throws com.liferay.portal.kernel.exception.PortalException,
738                            com.liferay.portal.kernel.exception.SystemException {
739                    getService()
740                            .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds,
741                            serviceContext);
742            }
743    
744            /**
745            * Deletes the job from the scheduler's queue.
746            *
747            * @param groupId the primary key of the group
748            * @param jobName the job name
749            * @param groupName the group name (optionally {@link
750            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
751            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
752            * @throws PortalException if the group did not permission to manage staging
753            and publish
754            * @throws SystemException if a system exception occurred
755            */
756            public static void unschedulePublishToLive(long groupId,
757                    java.lang.String jobName, java.lang.String groupName)
758                    throws com.liferay.portal.kernel.exception.PortalException,
759                            com.liferay.portal.kernel.exception.SystemException {
760                    getService().unschedulePublishToLive(groupId, jobName, groupName);
761            }
762    
763            /**
764            * Deletes the job from the scheduler's persistent queue.
765            *
766            * @param groupId the primary key of the group
767            * @param jobName the job name
768            * @param groupName the group name (optionally {@link
769            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
770            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
771            * @throws PortalException if a group with the primary key could not be
772            found or if the group did not have permission to publish
773            * @throws SystemException if a system exception occurred
774            */
775            public static void unschedulePublishToRemote(long groupId,
776                    java.lang.String jobName, java.lang.String groupName)
777                    throws com.liferay.portal.kernel.exception.PortalException,
778                            com.liferay.portal.kernel.exception.SystemException {
779                    getService().unschedulePublishToRemote(groupId, jobName, groupName);
780            }
781    
782            /**
783            * Updates the layout.
784            *
785            * @param groupId the primary key of the group
786            * @param privateLayout whether the layout is private to the group
787            * @param layoutId the primary key of the layout
788            * @param parentLayoutId the primary key of the layout's new parent layout
789            * @param localeNamesMap the layout's locales and localized names
790            * @param localeTitlesMap the layout's locales and localized titles
791            * @param descriptionMap the locales and localized descriptions to merge
792            (optionally <code>null</code>)
793            * @param keywordsMap the locales and localized keywords to merge
794            (optionally <code>null</code>)
795            * @param robotsMap the locales and localized robots to merge (optionally
796            <code>null</code>)
797            * @param type the layout's new type (optionally {@link
798            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET})
799            * @param hidden whether the layout is hidden
800            * @param friendlyURL the layout's new friendly URL (optionally {@link
801            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
802            or {@link
803            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}).
804            The default values can be overridden in
805            <code>portal-ext.properties</code> by specifying new values for
806            the corresponding properties defined in {@link
807            com.liferay.portal.util.PropsValues}. To see how the URL is
808            normalized when accessed see {@link
809            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
810            String)}.
811            * @param iconImage whether the icon image will be updated
812            * @param iconBytes the byte array of the layout's new icon image
813            * @param serviceContext the service context to be applied. Can set the
814            modification date and expando bridge attributes for the layout.
815            * @return the updated layout
816            * @throws PortalException if a group or layout with the primary key could
817            not be found, if the user did not have permission to update the
818            layout, if a unique friendly URL could not be generated, if a
819            valid parent layout ID to use could not be found, or if the
820            layout parameters were invalid
821            * @throws SystemException if a system exception occurred
822            */
823            public static com.liferay.portal.model.Layout updateLayout(long groupId,
824                    boolean privateLayout, long layoutId, long parentLayoutId,
825                    java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
826                    java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
827                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
828                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
829                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
830                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
831                    java.lang.Boolean iconImage, byte[] iconBytes,
832                    com.liferay.portal.service.ServiceContext serviceContext)
833                    throws com.liferay.portal.kernel.exception.PortalException,
834                            com.liferay.portal.kernel.exception.SystemException {
835                    return getService()
836                                       .updateLayout(groupId, privateLayout, layoutId,
837                            parentLayoutId, localeNamesMap, localeTitlesMap, descriptionMap,
838                            keywordsMap, robotsMap, type, hidden, friendlyURL, iconImage,
839                            iconBytes, serviceContext);
840            }
841    
842            /**
843            * Updates the layout replacing its type settings.
844            *
845            * @param groupId the primary key of the group
846            * @param privateLayout whether the layout is private to the group
847            * @param layoutId the primary key of the layout
848            * @param typeSettings the settings to load the unicode properties object.
849            See {@link com.liferay.portal.kernel.util.UnicodeProperties
850            #fastLoad(String)}.
851            * @return the updated layout
852            * @throws PortalException if a matching layout could not be found or if the
853            user did not have permission to update the layout
854            * @throws SystemException if a system exception occurred
855            */
856            public static com.liferay.portal.model.Layout updateLayout(long groupId,
857                    boolean privateLayout, long layoutId, java.lang.String typeSettings)
858                    throws com.liferay.portal.kernel.exception.PortalException,
859                            com.liferay.portal.kernel.exception.SystemException {
860                    return getService()
861                                       .updateLayout(groupId, privateLayout, layoutId, typeSettings);
862            }
863    
864            /**
865            * Updates the look and feel of the layout.
866            *
867            * @param groupId the primary key of the group
868            * @param privateLayout whether the layout is private to the group
869            * @param layoutId the primary key of the layout
870            * @param themeId the primary key of the layout's new theme
871            * @param colorSchemeId the primary key of the layout's new color scheme
872            * @param css the layout's new CSS
873            * @param wapTheme whether the theme is for WAP browsers
874            * @return the updated layout
875            * @throws PortalException if a matching layout could not be found, or if
876            the user did not have permission to update the layout and
877            permission to apply the theme
878            * @throws SystemException if a system exception occurred
879            */
880            public static com.liferay.portal.model.Layout updateLookAndFeel(
881                    long groupId, boolean privateLayout, long layoutId,
882                    java.lang.String themeId, java.lang.String colorSchemeId,
883                    java.lang.String css, boolean wapTheme)
884                    throws com.liferay.portal.kernel.exception.PortalException,
885                            com.liferay.portal.kernel.exception.SystemException {
886                    return getService()
887                                       .updateLookAndFeel(groupId, privateLayout, layoutId,
888                            themeId, colorSchemeId, css, wapTheme);
889            }
890    
891            /**
892            * Updates the name of the layout matching the group, layout ID, and
893            * privacy.
894            *
895            * @param groupId the primary key of the group
896            * @param privateLayout whether the layout is private to the group
897            * @param layoutId the primary key of the layout
898            * @param name the layout's new name
899            * @param languageId the primary key of the language. For more information
900            see {@link java.util.Locale}.
901            * @return the updated layout
902            * @throws PortalException if a matching layout could not be found, if the
903            user did not have permission to update the layout, or if the new
904            name was <code>null</code>
905            * @throws SystemException if a system exception occurred
906            */
907            public static com.liferay.portal.model.Layout updateName(long groupId,
908                    boolean privateLayout, long layoutId, java.lang.String name,
909                    java.lang.String languageId)
910                    throws com.liferay.portal.kernel.exception.PortalException,
911                            com.liferay.portal.kernel.exception.SystemException {
912                    return getService()
913                                       .updateName(groupId, privateLayout, layoutId, name,
914                            languageId);
915            }
916    
917            /**
918            * Updates the name of the layout matching the primary key.
919            *
920            * @param plid the primary key of the layout
921            * @param name the name to be assigned
922            * @param languageId the primary key of the language. For more information
923            see {@link java.util.Locale}.
924            * @return the updated layout
925            * @throws PortalException if a layout with the primary key could not be
926            found, or if the user did not have permission to update the
927            layout, or if the name was <code>null</code>
928            * @throws SystemException if a system exception occurred
929            */
930            public static com.liferay.portal.model.Layout updateName(long plid,
931                    java.lang.String name, java.lang.String languageId)
932                    throws com.liferay.portal.kernel.exception.PortalException,
933                            com.liferay.portal.kernel.exception.SystemException {
934                    return getService().updateName(plid, name, languageId);
935            }
936    
937            /**
938            * Updates the parent layout ID of the layout matching the group, layout ID,
939            * and privacy.
940            *
941            * @param groupId the primary key of the group
942            * @param privateLayout whether the layout is private to the group
943            * @param layoutId the primary key of the layout
944            * @param parentLayoutId the primary key to be assigned to the parent
945            layout
946            * @return the matching layout
947            * @throws PortalException if a valid parent layout ID to use could not be
948            found, if a matching layout could not be found, or if the user
949            did not have permission to update the layout
950            * @throws SystemException if a system exception occurred
951            */
952            public static com.liferay.portal.model.Layout updateParentLayoutId(
953                    long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
954                    throws com.liferay.portal.kernel.exception.PortalException,
955                            com.liferay.portal.kernel.exception.SystemException {
956                    return getService()
957                                       .updateParentLayoutId(groupId, privateLayout, layoutId,
958                            parentLayoutId);
959            }
960    
961            /**
962            * Updates the parent layout ID of the layout matching the primary key. If a
963            * layout matching the parent primary key is found, the layout ID of that
964            * layout is assigned, otherwise {@link
965            * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is
966            * assigned.
967            *
968            * @param plid the primary key of the layout
969            * @param parentPlid the primary key of the parent layout
970            * @return the layout matching the primary key
971            * @throws PortalException if a layout with the primary key could not be
972            found, if the user did not have permission to update the layout,
973            or if a valid parent layout ID to use could not be found
974            * @throws SystemException if a system exception occurred
975            */
976            public static com.liferay.portal.model.Layout updateParentLayoutId(
977                    long plid, long parentPlid)
978                    throws com.liferay.portal.kernel.exception.PortalException,
979                            com.liferay.portal.kernel.exception.SystemException {
980                    return getService().updateParentLayoutId(plid, parentPlid);
981            }
982    
983            /**
984            * Updates the priority of the layout matching the group, layout ID, and
985            * privacy.
986            *
987            * @param groupId the primary key of the group
988            * @param privateLayout whether the layout is private to the group
989            * @param layoutId the primary key of the layout
990            * @param priority the layout's new priority
991            * @return the updated layout
992            * @throws PortalException if a matching layout could not be found or if the
993            user did not have permission to update the layout
994            * @throws SystemException if a system exception occurred
995            */
996            public static com.liferay.portal.model.Layout updatePriority(long groupId,
997                    boolean privateLayout, long layoutId, int priority)
998                    throws com.liferay.portal.kernel.exception.PortalException,
999                            com.liferay.portal.kernel.exception.SystemException {
1000                    return getService()
1001                                       .updatePriority(groupId, privateLayout, layoutId, priority);
1002            }
1003    
1004            /**
1005            * Updates the priority of the layout matching the primary key.
1006            *
1007            * @param plid the primary key of the layout
1008            * @param priority the layout's new priority
1009            * @return the updated layout
1010            * @throws PortalException if a layout with the primary key could not be
1011            found
1012            * @throws SystemException if a system exception occurred
1013            */
1014            public static com.liferay.portal.model.Layout updatePriority(long plid,
1015                    int priority)
1016                    throws com.liferay.portal.kernel.exception.PortalException,
1017                            com.liferay.portal.kernel.exception.SystemException {
1018                    return getService().updatePriority(plid, priority);
1019            }
1020    
1021            public static LayoutService getService() {
1022                    if (_service == null) {
1023                            _service = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName());
1024    
1025                            ReferenceRegistry.registerReference(LayoutServiceUtil.class,
1026                                    "_service");
1027                    }
1028    
1029                    return _service;
1030            }
1031    
1032            /**
1033             * @deprecated As of 6.2.0
1034             */
1035            public void setService(LayoutService service) {
1036            }
1037    
1038            private static LayoutService _service;
1039    }