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