001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.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. Must set the UUID for the
095            layout. Can set the creation date, modification date and the
096            expando bridge attributes for the layout. For layouts that belong
097            to a layout set prototype, an attribute named 'layoutUpdateable'
098            can be used to specify whether site administrators can modify
099            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. Must set the UUID for the
159            layout. Can specify the creation date, modification date and the
160            expando bridge attributes for the layout. For layouts that belong
161            to a layout set prototype, an attribute named 'layoutUpdateable'
162            can be used to specify whether site administrators can modify
163            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
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
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            /**
410            * @param uuid the layout's UUID
411            * @param groupId the primary key of the group
412            * @param privateLayout whether the layout is private to the group
413            * @return the matching layout
414            * @throws PortalException if a matching layout could not be found, if the
415            user did not have permission to view the layout, or if some other
416            portal exception occurred
417            * @throws SystemException if a system exception occurred
418            */
419            public static com.liferay.portal.model.Layout getLayoutByUuidAndGroupId(
420                    java.lang.String uuid, long groupId, boolean privateLayout)
421                    throws com.liferay.portal.kernel.exception.PortalException,
422                            com.liferay.portal.kernel.exception.SystemException {
423                    return getService()
424                                       .getLayoutByUuidAndGroupId(uuid, groupId, privateLayout);
425            }
426    
427            /**
428            * Returns the name of the layout.
429            *
430            * @param groupId the primary key of the group
431            * @param privateLayout whether the layout is private to the group
432            * @param layoutId the primary key of the layout
433            * @param languageId the primary key of the language. For more information
434            See {@link java.util.Locale}.
435            * @return the layout's name
436            * @throws PortalException if a matching layout could not be found
437            * @throws SystemException if a system exception occurred
438            */
439            public static java.lang.String getLayoutName(long groupId,
440                    boolean privateLayout, long layoutId, java.lang.String languageId)
441                    throws com.liferay.portal.kernel.exception.PortalException,
442                            com.liferay.portal.kernel.exception.SystemException {
443                    return getService()
444                                       .getLayoutName(groupId, privateLayout, layoutId, languageId);
445            }
446    
447            /**
448            * Returns the layout references for all the layouts that belong to the
449            * company and belong to the portlet that matches the preferences.
450            *
451            * @param companyId the primary key of the company
452            * @param portletId the primary key of the portlet
453            * @param preferencesKey the portlet's preference key
454            * @param preferencesValue the portlet's preference value
455            * @return the layout references of the matching layouts
456            * @throws SystemException if a system exception occurred
457            */
458            public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
459                    long companyId, java.lang.String portletId,
460                    java.lang.String preferencesKey, java.lang.String preferencesValue)
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    return getService()
463                                       .getLayoutReferences(companyId, portletId, preferencesKey,
464                            preferencesValue);
465            }
466    
467            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
468                    long groupId, boolean privateLayout)
469                    throws com.liferay.portal.kernel.exception.SystemException {
470                    return getService().getLayouts(groupId, privateLayout);
471            }
472    
473            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
474                    long groupId, boolean privateLayout, long parentLayoutId)
475                    throws com.liferay.portal.kernel.exception.SystemException {
476                    return getService().getLayouts(groupId, privateLayout, parentLayoutId);
477            }
478    
479            public static java.util.List<com.liferay.portal.model.Layout> getLayouts(
480                    long groupId, boolean privateLayout, long parentLayoutId,
481                    boolean incomplete, int start, int end)
482                    throws com.liferay.portal.kernel.exception.PortalException,
483                            com.liferay.portal.kernel.exception.SystemException {
484                    return getService()
485                                       .getLayouts(groupId, privateLayout, parentLayoutId,
486                            incomplete, start, end);
487            }
488    
489            /**
490            * Imports the layouts from the byte array.
491            *
492            * @param groupId the primary key of the group
493            * @param privateLayout whether the layout is private to the group
494            * @param parameterMap the mapping of parameters indicating which
495            information will be imported. For information on the keys used in
496            the map see {@link
497            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
498            * @param bytes the byte array with the data
499            * @throws PortalException if a group with the primary key could not be
500            found, if the group did not have permission to manage the
501            layouts, or if some other portal exception occurred
502            * @throws SystemException if a system exception occurred
503            * @see com.liferay.portal.lar.LayoutImporter
504            */
505            public static void importLayouts(long groupId, boolean privateLayout,
506                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
507                    byte[] bytes)
508                    throws com.liferay.portal.kernel.exception.PortalException,
509                            com.liferay.portal.kernel.exception.SystemException {
510                    getService().importLayouts(groupId, privateLayout, parameterMap, bytes);
511            }
512    
513            /**
514            * Imports the layouts from the file.
515            *
516            * @param groupId the primary key of the group
517            * @param privateLayout whether the layout is private to the group
518            * @param parameterMap the mapping of parameters indicating which
519            information will be imported. For information on the keys used in
520            the map see {@link
521            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
522            * @param file the LAR file with the data
523            * @throws PortalException if a group with the primary key could not be
524            found, if the group did not have permission to manage the layouts
525            and publish, or if some other portal exception occurred
526            * @throws SystemException if a system exception occurred
527            * @see com.liferay.portal.lar.LayoutImporter
528            */
529            public static void importLayouts(long groupId, boolean privateLayout,
530                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
531                    java.io.File file)
532                    throws com.liferay.portal.kernel.exception.PortalException,
533                            com.liferay.portal.kernel.exception.SystemException {
534                    getService().importLayouts(groupId, privateLayout, parameterMap, file);
535            }
536    
537            /**
538            * Imports the layouts from the input stream.
539            *
540            * @param groupId the primary key of the group
541            * @param privateLayout whether the layout is private to the group
542            * @param parameterMap the mapping of parameters indicating which
543            information will be imported. For information on the keys used in
544            the map see {@link
545            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
546            * @param is the input stream
547            * @throws PortalException if a group with the primary key could not be
548            found, if the group did not have permission to manage the
549            layouts, or if some other portal exception occurred
550            * @throws SystemException if a system exception occurred
551            * @see com.liferay.portal.lar.LayoutImporter
552            */
553            public static void importLayouts(long groupId, boolean privateLayout,
554                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
555                    java.io.InputStream is)
556                    throws com.liferay.portal.kernel.exception.PortalException,
557                            com.liferay.portal.kernel.exception.SystemException {
558                    getService().importLayouts(groupId, privateLayout, parameterMap, is);
559            }
560    
561            /**
562            * Imports the portlet information (categories, permissions, ... etc.) from
563            * the file.
564            *
565            * @param plid the primary key of the layout
566            * @param groupId the primary key of the group
567            * @param portletId the primary key of the portlet
568            * @param parameterMap the mapping of parameters indicating which
569            information will be imported. For information on the keys used in
570            the map see {@link
571            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
572            * @param file the LAR file with the data
573            * @throws PortalException if a group, layout, or portlet with the primary
574            key could not be found, or if the group did not have permission
575            to manage the layouts
576            * @throws SystemException if a system exception occurred
577            */
578            public static void importPortletInfo(long plid, long groupId,
579                    java.lang.String portletId,
580                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
581                    java.io.File file)
582                    throws com.liferay.portal.kernel.exception.PortalException,
583                            com.liferay.portal.kernel.exception.SystemException {
584                    getService()
585                            .importPortletInfo(plid, groupId, portletId, parameterMap, file);
586            }
587    
588            /**
589            * Imports the portlet information (categories, permissions, ... etc.) from
590            * the input stream.
591            *
592            * @param plid the primary key of the layout
593            * @param groupId the primary key of the group
594            * @param portletId the primary key of the portlet
595            * @param parameterMap the mapping of parameters indicating which
596            information will be imported. For information on the keys used in
597            the map see {@link
598            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}.
599            * @param is the input stream
600            * @throws PortalException if a group, portlet, or layout with the primary
601            key could not be found or if the group did not have permission to
602            manage the layouts
603            * @throws SystemException if a system exception occurred
604            */
605            public static void importPortletInfo(long plid, long groupId,
606                    java.lang.String portletId,
607                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
608                    java.io.InputStream is)
609                    throws com.liferay.portal.kernel.exception.PortalException,
610                            com.liferay.portal.kernel.exception.SystemException {
611                    getService()
612                            .importPortletInfo(plid, groupId, portletId, parameterMap, is);
613            }
614    
615            /**
616            * Schedules a range of layouts to be published.
617            *
618            * @param sourceGroupId the primary key of the source group
619            * @param targetGroupId the primary key of the target group
620            * @param privateLayout whether the layout is private to the group
621            * @param layoutIdMap the layouts considered for publishing, specified by
622            the layout IDs and booleans indicating whether they have children
623            * @param parameterMap the mapping of parameters indicating which
624            information will be used. See {@link
625            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}
626            * @param scope the scope of the pages. It can be <code>all-pages</code> or
627            <code>selected-pages</code>.
628            * @param startDate the start date
629            * @param endDate the end date
630            * @param groupName the group name (optionally {@link
631            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
632            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
633            * @param cronText the cron text. See {@link
634            com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText}
635            * @param schedulerStartDate the scheduler start date
636            * @param schedulerEndDate the scheduler end date
637            * @param description the scheduler description
638            * @throws PortalException if the group did not have permission to manage
639            and publish
640            * @throws SystemException if a system exception occurred
641            */
642            public static void schedulePublishToLive(long sourceGroupId,
643                    long targetGroupId, boolean privateLayout,
644                    java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
645                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
646                    java.lang.String scope, java.util.Date startDate,
647                    java.util.Date endDate, java.lang.String groupName,
648                    java.lang.String cronText, java.util.Date schedulerStartDate,
649                    java.util.Date schedulerEndDate, java.lang.String description)
650                    throws com.liferay.portal.kernel.exception.PortalException,
651                            com.liferay.portal.kernel.exception.SystemException {
652                    getService()
653                            .schedulePublishToLive(sourceGroupId, targetGroupId, privateLayout,
654                            layoutIdMap, parameterMap, scope, startDate, endDate, groupName,
655                            cronText, schedulerStartDate, schedulerEndDate, description);
656            }
657    
658            /**
659            * Schedules a range of layouts to be stored.
660            *
661            * @param sourceGroupId the primary key of the source group
662            * @param privateLayout whether the layout is private to the group
663            * @param layoutIdMap the layouts considered for publishing, specified by
664            the layout IDs and booleans indicating whether they have children
665            * @param parameterMap the mapping of parameters indicating which
666            information will be used. See {@link
667            com.liferay.portal.kernel.lar.PortletDataHandlerKeys}
668            * @param remoteAddress the remote address
669            * @param remotePort the remote port
670            * @param remotePathContext the remote path context
671            * @param secureConnection whether the connection is secure
672            * @param remoteGroupId the primary key of the remote group
673            * @param remotePrivateLayout whether remote group's layout is private
674            * @param startDate the start date
675            * @param endDate the end date
676            * @param groupName the group name. Optionally {@link
677            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
678            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
679            * @param cronText the cron text. See {@link
680            com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText}
681            * @param schedulerStartDate the scheduler start date
682            * @param schedulerEndDate the scheduler end date
683            * @param description the scheduler description
684            * @throws PortalException if a group with the source group primary key was
685            not found or if the group did not have permission to publish
686            * @throws SystemException if a system exception occurred
687            */
688            public static void schedulePublishToRemote(long sourceGroupId,
689                    boolean privateLayout,
690                    java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
691                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
692                    java.lang.String remoteAddress, int remotePort,
693                    java.lang.String remotePathContext, boolean secureConnection,
694                    long remoteGroupId, boolean remotePrivateLayout,
695                    java.util.Date startDate, java.util.Date endDate,
696                    java.lang.String groupName, java.lang.String cronText,
697                    java.util.Date schedulerStartDate, java.util.Date schedulerEndDate,
698                    java.lang.String description)
699                    throws com.liferay.portal.kernel.exception.PortalException,
700                            com.liferay.portal.kernel.exception.SystemException {
701                    getService()
702                            .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap,
703                            parameterMap, remoteAddress, remotePort, remotePathContext,
704                            secureConnection, remoteGroupId, remotePrivateLayout, startDate,
705                            endDate, groupName, cronText, schedulerStartDate, schedulerEndDate,
706                            description);
707            }
708    
709            /**
710            * Sets the layouts for the group, replacing and prioritizing all layouts of
711            * the parent layout.
712            *
713            * @param groupId the primary key of the group
714            * @param privateLayout whether the layout is private to the group
715            * @param parentLayoutId the primary key of the parent layout
716            * @param layoutIds the primary keys of the layouts
717            * @param serviceContext the service context
718            * @throws PortalException if a group or layout with the primary key could
719            not be found, if the group did not have permission to manage the
720            layouts, if no layouts were specified, if the first layout was
721            not page-able, if the first layout was hidden, or if some other
722            portal exception occurred
723            * @throws SystemException if a system exception occurred
724            */
725            public static void setLayouts(long groupId, boolean privateLayout,
726                    long parentLayoutId, long[] layoutIds,
727                    com.liferay.portal.service.ServiceContext serviceContext)
728                    throws com.liferay.portal.kernel.exception.PortalException,
729                            com.liferay.portal.kernel.exception.SystemException {
730                    getService()
731                            .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds,
732                            serviceContext);
733            }
734    
735            /**
736            * Deletes the job from the scheduler's queue.
737            *
738            * @param groupId the primary key of the group
739            * @param jobName the job name
740            * @param groupName the group name (optionally {@link
741            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
742            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
743            * @throws PortalException if the group did not permission to manage staging
744            and publish
745            * @throws SystemException if a system exception occurred
746            */
747            public static void unschedulePublishToLive(long groupId,
748                    java.lang.String jobName, java.lang.String groupName)
749                    throws com.liferay.portal.kernel.exception.PortalException,
750                            com.liferay.portal.kernel.exception.SystemException {
751                    getService().unschedulePublishToLive(groupId, jobName, groupName);
752            }
753    
754            /**
755            * Deletes the job from the scheduler's persistent queue.
756            *
757            * @param groupId the primary key of the group
758            * @param jobName the job name
759            * @param groupName the group name (optionally {@link
760            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
761            See {@link com.liferay.portal.kernel.messaging.DestinationNames}.
762            * @throws PortalException if a group with the primary key could not be
763            found or if the group did not have permission to publish
764            * @throws SystemException if a system exception occurred
765            */
766            public static void unschedulePublishToRemote(long groupId,
767                    java.lang.String jobName, java.lang.String groupName)
768                    throws com.liferay.portal.kernel.exception.PortalException,
769                            com.liferay.portal.kernel.exception.SystemException {
770                    getService().unschedulePublishToRemote(groupId, jobName, groupName);
771            }
772    
773            /**
774            * Updates the layout.
775            *
776            * @param groupId the primary key of the group
777            * @param privateLayout whether the layout is private to the group
778            * @param layoutId the primary key of the layout
779            * @param parentLayoutId the primary key of the layout's new parent layout
780            * @param localeNamesMap the layout's locales and localized names
781            * @param localeTitlesMap the layout's locales and localized titles
782            * @param descriptionMap the locales and localized descriptions to merge
783            (optionally <code>null</code>)
784            * @param keywordsMap the locales and localized keywords to merge
785            (optionally <code>null</code>)
786            * @param robotsMap the locales and localized robots to merge (optionally
787            <code>null</code>)
788            * @param type the layout's new type (optionally {@link
789            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET})
790            * @param hidden whether the layout is hidden
791            * @param friendlyURL the layout's new friendly URL (optionally {@link
792            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
793            or {@link
794            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}).
795            The default values can be overridden in
796            <code>portal-ext.properties</code> by specifying new values for
797            the corresponding properties defined in {@link
798            com.liferay.portal.util.PropsValues}. To see how the URL is
799            normalized when accessed see {@link
800            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
801            String)}.
802            * @param iconImage whether the icon image will be updated
803            * @param iconBytes the byte array of the layout's new icon image
804            * @param serviceContext the service context. Can set the modification date
805            and expando bridge attributes for the layout.
806            * @return the updated layout
807            * @throws PortalException if a group or layout with the primary key could
808            not be found, if the user did not have permission to update the
809            layout, if a unique friendly URL could not be generated, if a
810            valid parent layout ID to use could not be found, or if the
811            layout parameters were invalid
812            * @throws SystemException if a system exception occurred
813            */
814            public static com.liferay.portal.model.Layout updateLayout(long groupId,
815                    boolean privateLayout, long layoutId, long parentLayoutId,
816                    java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
817                    java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
818                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
819                    java.util.Map<java.util.Locale, java.lang.String> keywordsMap,
820                    java.util.Map<java.util.Locale, java.lang.String> robotsMap,
821                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
822                    java.lang.Boolean iconImage, byte[] iconBytes,
823                    com.liferay.portal.service.ServiceContext serviceContext)
824                    throws com.liferay.portal.kernel.exception.PortalException,
825                            com.liferay.portal.kernel.exception.SystemException {
826                    return getService()
827                                       .updateLayout(groupId, privateLayout, layoutId,
828                            parentLayoutId, localeNamesMap, localeTitlesMap, descriptionMap,
829                            keywordsMap, robotsMap, type, hidden, friendlyURL, iconImage,
830                            iconBytes, serviceContext);
831            }
832    
833            /**
834            * Updates the layout replacing its type settings.
835            *
836            * @param groupId the primary key of the group
837            * @param privateLayout whether the layout is private to the group
838            * @param layoutId the primary key of the layout
839            * @param typeSettings the settings to load the unicode properties object.
840            See {@link com.liferay.portal.kernel.util.UnicodeProperties
841            #fastLoad(String)}.
842            * @return the updated layout
843            * @throws PortalException if a matching layout could not be found or if the
844            user did not have permission to update the layout
845            * @throws SystemException if a system exception occurred
846            */
847            public static com.liferay.portal.model.Layout updateLayout(long groupId,
848                    boolean privateLayout, long layoutId, java.lang.String typeSettings)
849                    throws com.liferay.portal.kernel.exception.PortalException,
850                            com.liferay.portal.kernel.exception.SystemException {
851                    return getService()
852                                       .updateLayout(groupId, privateLayout, layoutId, typeSettings);
853            }
854    
855            /**
856            * Updates the look and feel of the layout.
857            *
858            * @param groupId the primary key of the group
859            * @param privateLayout whether the layout is private to the group
860            * @param layoutId the primary key of the layout
861            * @param themeId the primary key of the layout's new theme
862            * @param colorSchemeId the primary key of the layout's new color scheme
863            * @param css the layout's new CSS
864            * @param wapTheme whether the theme is for WAP browsers
865            * @return the updated layout
866            * @throws PortalException if a matching layout could not be found, or if
867            the user did not have permission to update the layout and
868            permission to apply the theme
869            * @throws SystemException if a system exception occurred
870            */
871            public static com.liferay.portal.model.Layout updateLookAndFeel(
872                    long groupId, boolean privateLayout, long layoutId,
873                    java.lang.String themeId, java.lang.String colorSchemeId,
874                    java.lang.String css, boolean wapTheme)
875                    throws com.liferay.portal.kernel.exception.PortalException,
876                            com.liferay.portal.kernel.exception.SystemException {
877                    return getService()
878                                       .updateLookAndFeel(groupId, privateLayout, layoutId,
879                            themeId, colorSchemeId, css, wapTheme);
880            }
881    
882            /**
883            * Updates the name of the layout matching the group, layout ID, and
884            * privacy.
885            *
886            * @param groupId the primary key of the group
887            * @param privateLayout whether the layout is private to the group
888            * @param layoutId the primary key of the layout
889            * @param name the layout's new name
890            * @param languageId the primary key of the language. For more information
891            see {@link java.util.Locale}.
892            * @return the updated layout
893            * @throws PortalException if a matching layout could not be found, if the
894            user did not have permission to update the layout, or if the new
895            name was <code>null</code>
896            * @throws SystemException if a system exception occurred
897            */
898            public static com.liferay.portal.model.Layout updateName(long groupId,
899                    boolean privateLayout, long layoutId, java.lang.String name,
900                    java.lang.String languageId)
901                    throws com.liferay.portal.kernel.exception.PortalException,
902                            com.liferay.portal.kernel.exception.SystemException {
903                    return getService()
904                                       .updateName(groupId, privateLayout, layoutId, name,
905                            languageId);
906            }
907    
908            /**
909            * Updates the name of the layout matching the primary key.
910            *
911            * @param plid the primary key of the layout
912            * @param name the name to be assigned
913            * @param languageId the primary key of the language. For more information
914            see {@link java.util.Locale}.
915            * @return the updated layout
916            * @throws PortalException if a layout with the primary key could not be
917            found, or if the user did not have permission to update the
918            layout, or if the name was <code>null</code>
919            * @throws SystemException if a system exception occurred
920            */
921            public static com.liferay.portal.model.Layout updateName(long plid,
922                    java.lang.String name, java.lang.String languageId)
923                    throws com.liferay.portal.kernel.exception.PortalException,
924                            com.liferay.portal.kernel.exception.SystemException {
925                    return getService().updateName(plid, name, languageId);
926            }
927    
928            /**
929            * Updates the parent layout ID of the layout matching the group, layout ID,
930            * and privacy.
931            *
932            * @param groupId the primary key of the group
933            * @param privateLayout whether the layout is private to the group
934            * @param layoutId the primary key of the layout
935            * @param parentLayoutId the primary key to be assigned to the parent
936            layout
937            * @return the matching layout
938            * @throws PortalException if a valid parent layout ID to use could not be
939            found, if a matching layout could not be found, or if the user
940            did not have permission to update the layout
941            * @throws SystemException if a system exception occurred
942            */
943            public static com.liferay.portal.model.Layout updateParentLayoutId(
944                    long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
945                    throws com.liferay.portal.kernel.exception.PortalException,
946                            com.liferay.portal.kernel.exception.SystemException {
947                    return getService()
948                                       .updateParentLayoutId(groupId, privateLayout, layoutId,
949                            parentLayoutId);
950            }
951    
952            /**
953            * Updates the parent layout ID of the layout matching the primary key. If a
954            * layout matching the parent primary key is found, the layout ID of that
955            * layout is assigned, otherwise {@link
956            * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is
957            * assigned.
958            *
959            * @param plid the primary key of the layout
960            * @param parentPlid the primary key of the parent layout
961            * @return the layout matching the primary key
962            * @throws PortalException if a layout with the primary key could not be
963            found, if the user did not have permission to update the layout,
964            or if a valid parent layout ID to use could not be found
965            * @throws SystemException if a system exception occurred
966            */
967            public static com.liferay.portal.model.Layout updateParentLayoutId(
968                    long plid, long parentPlid)
969                    throws com.liferay.portal.kernel.exception.PortalException,
970                            com.liferay.portal.kernel.exception.SystemException {
971                    return getService().updateParentLayoutId(plid, parentPlid);
972            }
973    
974            /**
975            * Updates the priority of the layout matching the group, layout ID, and
976            * privacy.
977            *
978            * @param groupId the primary key of the group
979            * @param privateLayout whether the layout is private to the group
980            * @param layoutId the primary key of the layout
981            * @param priority the layout's new priority
982            * @return the updated layout
983            * @throws PortalException if a matching layout could not be found or if the
984            user did not have permission to update the layout
985            * @throws SystemException if a system exception occurred
986            */
987            public static com.liferay.portal.model.Layout updatePriority(long groupId,
988                    boolean privateLayout, long layoutId, int priority)
989                    throws com.liferay.portal.kernel.exception.PortalException,
990                            com.liferay.portal.kernel.exception.SystemException {
991                    return getService()
992                                       .updatePriority(groupId, privateLayout, layoutId, priority);
993            }
994    
995            /**
996            * Updates the priority of the layout matching the primary key.
997            *
998            * @param plid the primary key of the layout
999            * @param priority the layout's new priority
1000            * @return the updated layout
1001            * @throws PortalException if a layout with the primary key could not be
1002            found
1003            * @throws SystemException if a system exception occurred
1004            */
1005            public static com.liferay.portal.model.Layout updatePriority(long plid,
1006                    int priority)
1007                    throws com.liferay.portal.kernel.exception.PortalException,
1008                            com.liferay.portal.kernel.exception.SystemException {
1009                    return getService().updatePriority(plid, priority);
1010            }
1011    
1012            public static LayoutService getService() {
1013                    if (_service == null) {
1014                            _service = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName());
1015    
1016                            ReferenceRegistry.registerReference(LayoutServiceUtil.class,
1017                                    "_service");
1018                    }
1019    
1020                    return _service;
1021            }
1022    
1023            /**
1024             * @deprecated
1025             */
1026            public void setService(LayoutService service) {
1027            }
1028    
1029            private static LayoutService _service;
1030    }