1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="LayoutServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link LayoutService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       LayoutService
39   * @generated
40   */
41  public class LayoutServiceUtil {
42      public static com.liferay.portal.model.Layout addLayout(long groupId,
43          boolean privateLayout, long parentLayoutId,
44          java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
45          java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
46          java.lang.String description, java.lang.String type, boolean hidden,
47          java.lang.String friendlyURL)
48          throws com.liferay.portal.PortalException,
49              com.liferay.portal.SystemException {
50          return getService()
51                     .addLayout(groupId, privateLayout, parentLayoutId,
52              localeNamesMap, localeTitlesMap, description, type, hidden,
53              friendlyURL);
54      }
55  
56      public static com.liferay.portal.model.Layout addLayout(long groupId,
57          boolean privateLayout, long parentLayoutId, java.lang.String name,
58          java.lang.String title, java.lang.String description,
59          java.lang.String type, boolean hidden, java.lang.String friendlyURL)
60          throws com.liferay.portal.PortalException,
61              com.liferay.portal.SystemException {
62          return getService()
63                     .addLayout(groupId, privateLayout, parentLayoutId, name,
64              title, description, type, hidden, friendlyURL);
65      }
66  
67      public static void deleteLayout(long plid)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          getService().deleteLayout(plid);
71      }
72  
73      public static void deleteLayout(long groupId, boolean privateLayout,
74          long layoutId)
75          throws com.liferay.portal.PortalException,
76              com.liferay.portal.SystemException {
77          getService().deleteLayout(groupId, privateLayout, layoutId);
78      }
79  
80      public static byte[] exportLayouts(long groupId, boolean privateLayout,
81          long[] layoutIds,
82          java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
83          java.util.Date startDate, java.util.Date endDate)
84          throws com.liferay.portal.PortalException,
85              com.liferay.portal.SystemException {
86          return getService()
87                     .exportLayouts(groupId, privateLayout, layoutIds,
88              parameterMap, startDate, endDate);
89      }
90  
91      public static byte[] exportLayouts(long groupId, boolean privateLayout,
92          java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
93          java.util.Date startDate, java.util.Date endDate)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException {
96          return getService()
97                     .exportLayouts(groupId, privateLayout, parameterMap,
98              startDate, endDate);
99      }
100 
101     public static java.io.File exportLayoutsAsFile(long groupId,
102         boolean privateLayout, long[] layoutIds,
103         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
104         java.util.Date startDate, java.util.Date endDate)
105         throws com.liferay.portal.PortalException,
106             com.liferay.portal.SystemException {
107         return getService()
108                    .exportLayoutsAsFile(groupId, privateLayout, layoutIds,
109             parameterMap, startDate, endDate);
110     }
111 
112     public static byte[] exportPortletInfo(long plid, long groupId,
113         java.lang.String portletId,
114         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
115         java.util.Date startDate, java.util.Date endDate)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         return getService()
119                    .exportPortletInfo(plid, groupId, portletId, parameterMap,
120             startDate, endDate);
121     }
122 
123     public static java.io.File exportPortletInfoAsFile(long plid, long groupId,
124         java.lang.String portletId,
125         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
126         java.util.Date startDate, java.util.Date endDate)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         return getService()
130                    .exportPortletInfoAsFile(plid, groupId, portletId,
131             parameterMap, startDate, endDate);
132     }
133 
134     public static java.lang.String getLayoutName(long groupId,
135         boolean privateLayout, long layoutId, java.lang.String languageId)
136         throws com.liferay.portal.PortalException,
137             com.liferay.portal.SystemException {
138         return getService()
139                    .getLayoutName(groupId, privateLayout, layoutId, languageId);
140     }
141 
142     public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
143         long companyId, java.lang.String portletId,
144         java.lang.String preferencesKey, java.lang.String preferencesValue)
145         throws com.liferay.portal.SystemException {
146         return getService()
147                    .getLayoutReferences(companyId, portletId, preferencesKey,
148             preferencesValue);
149     }
150 
151     public static void importLayouts(long groupId, boolean privateLayout,
152         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
153         byte[] bytes)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException {
156         getService().importLayouts(groupId, privateLayout, parameterMap, bytes);
157     }
158 
159     public static void importLayouts(long groupId, boolean privateLayout,
160         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
161         java.io.File file)
162         throws com.liferay.portal.PortalException,
163             com.liferay.portal.SystemException {
164         getService().importLayouts(groupId, privateLayout, parameterMap, file);
165     }
166 
167     public static void importLayouts(long groupId, boolean privateLayout,
168         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
169         java.io.InputStream is)
170         throws com.liferay.portal.PortalException,
171             com.liferay.portal.SystemException {
172         getService().importLayouts(groupId, privateLayout, parameterMap, is);
173     }
174 
175     public static void importPortletInfo(long plid, long groupId,
176         java.lang.String portletId,
177         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
178         java.io.File file)
179         throws com.liferay.portal.PortalException,
180             com.liferay.portal.SystemException {
181         getService()
182             .importPortletInfo(plid, groupId, portletId, parameterMap, file);
183     }
184 
185     public static void importPortletInfo(long plid, long groupId,
186         java.lang.String portletId,
187         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
188         java.io.InputStream is)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         getService()
192             .importPortletInfo(plid, groupId, portletId, parameterMap, is);
193     }
194 
195     public static void schedulePublishToLive(long sourceGroupId,
196         long targetGroupId, boolean privateLayout,
197         java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
198         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
199         java.lang.String scope, java.util.Date startDate,
200         java.util.Date endDate, java.lang.String groupName,
201         java.lang.String cronText, java.util.Date schedulerStartDate,
202         java.util.Date schedulerEndDate, java.lang.String description)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         getService()
206             .schedulePublishToLive(sourceGroupId, targetGroupId, privateLayout,
207             layoutIdMap, parameterMap, scope, startDate, endDate, groupName,
208             cronText, schedulerStartDate, schedulerEndDate, description);
209     }
210 
211     public static void schedulePublishToRemote(long sourceGroupId,
212         boolean privateLayout,
213         java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap,
214         java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
215         java.lang.String remoteAddress, int remotePort,
216         boolean secureConnection, long remoteGroupId,
217         boolean remotePrivateLayout, java.util.Date startDate,
218         java.util.Date endDate, java.lang.String groupName,
219         java.lang.String cronText, java.util.Date schedulerStartDate,
220         java.util.Date schedulerEndDate, java.lang.String description)
221         throws com.liferay.portal.PortalException,
222             com.liferay.portal.SystemException {
223         getService()
224             .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap,
225             parameterMap, remoteAddress, remotePort, secureConnection,
226             remoteGroupId, remotePrivateLayout, startDate, endDate, groupName,
227             cronText, schedulerStartDate, schedulerEndDate, description);
228     }
229 
230     public static void setLayouts(long groupId, boolean privateLayout,
231         long parentLayoutId, long[] layoutIds)
232         throws com.liferay.portal.PortalException,
233             com.liferay.portal.SystemException {
234         getService()
235             .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds);
236     }
237 
238     public static void unschedulePublishToLive(long groupId,
239         java.lang.String jobName, java.lang.String groupName)
240         throws com.liferay.portal.PortalException,
241             com.liferay.portal.SystemException {
242         getService().unschedulePublishToLive(groupId, jobName, groupName);
243     }
244 
245     public static void unschedulePublishToRemote(long groupId,
246         java.lang.String jobName, java.lang.String groupName)
247         throws com.liferay.portal.PortalException,
248             com.liferay.portal.SystemException {
249         getService().unschedulePublishToRemote(groupId, jobName, groupName);
250     }
251 
252     public static com.liferay.portal.model.Layout updateLayout(long groupId,
253         boolean privateLayout, long layoutId, long parentLayoutId,
254         java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
255         java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
256         java.lang.String description, java.lang.String type, boolean hidden,
257         java.lang.String friendlyURL)
258         throws com.liferay.portal.PortalException,
259             com.liferay.portal.SystemException {
260         return getService()
261                    .updateLayout(groupId, privateLayout, layoutId,
262             parentLayoutId, localeNamesMap, localeTitlesMap, description, type,
263             hidden, friendlyURL);
264     }
265 
266     public static com.liferay.portal.model.Layout updateLayout(long groupId,
267         boolean privateLayout, long layoutId, long parentLayoutId,
268         java.util.Map<java.util.Locale, java.lang.String> localeNamesMap,
269         java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap,
270         java.lang.String description, java.lang.String type, boolean hidden,
271         java.lang.String friendlyURL, java.lang.Boolean iconImage,
272         byte[] iconBytes)
273         throws com.liferay.portal.PortalException,
274             com.liferay.portal.SystemException {
275         return getService()
276                    .updateLayout(groupId, privateLayout, layoutId,
277             parentLayoutId, localeNamesMap, localeTitlesMap, description, type,
278             hidden, friendlyURL, iconImage, iconBytes);
279     }
280 
281     public static com.liferay.portal.model.Layout updateLayout(long groupId,
282         boolean privateLayout, long layoutId, java.lang.String typeSettings)
283         throws com.liferay.portal.PortalException,
284             com.liferay.portal.SystemException {
285         return getService()
286                    .updateLayout(groupId, privateLayout, layoutId, typeSettings);
287     }
288 
289     public static com.liferay.portal.model.Layout updateLookAndFeel(
290         long groupId, boolean privateLayout, long layoutId,
291         java.lang.String themeId, java.lang.String colorSchemeId,
292         java.lang.String css, boolean wapTheme)
293         throws com.liferay.portal.PortalException,
294             com.liferay.portal.SystemException {
295         return getService()
296                    .updateLookAndFeel(groupId, privateLayout, layoutId,
297             themeId, colorSchemeId, css, wapTheme);
298     }
299 
300     public static com.liferay.portal.model.Layout updateName(long groupId,
301         boolean privateLayout, long layoutId, java.lang.String name,
302         java.lang.String languageId)
303         throws com.liferay.portal.PortalException,
304             com.liferay.portal.SystemException {
305         return getService()
306                    .updateName(groupId, privateLayout, layoutId, name,
307             languageId);
308     }
309 
310     public static com.liferay.portal.model.Layout updateName(long plid,
311         java.lang.String name, java.lang.String languageId)
312         throws com.liferay.portal.PortalException,
313             com.liferay.portal.SystemException {
314         return getService().updateName(plid, name, languageId);
315     }
316 
317     public static com.liferay.portal.model.Layout updateParentLayoutId(
318         long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
319         throws com.liferay.portal.PortalException,
320             com.liferay.portal.SystemException {
321         return getService()
322                    .updateParentLayoutId(groupId, privateLayout, layoutId,
323             parentLayoutId);
324     }
325 
326     public static com.liferay.portal.model.Layout updateParentLayoutId(
327         long plid, long parentPlid)
328         throws com.liferay.portal.PortalException,
329             com.liferay.portal.SystemException {
330         return getService().updateParentLayoutId(plid, parentPlid);
331     }
332 
333     public static com.liferay.portal.model.Layout updatePriority(long groupId,
334         boolean privateLayout, long layoutId, int priority)
335         throws com.liferay.portal.PortalException,
336             com.liferay.portal.SystemException {
337         return getService()
338                    .updatePriority(groupId, privateLayout, layoutId, priority);
339     }
340 
341     public static com.liferay.portal.model.Layout updatePriority(long plid,
342         int priority)
343         throws com.liferay.portal.PortalException,
344             com.liferay.portal.SystemException {
345         return getService().updatePriority(plid, priority);
346     }
347 
348     public static LayoutService getService() {
349         if (_service == null) {
350             _service = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName());
351 
352             ReferenceRegistry.registerReference(LayoutServiceUtil.class,
353                 "_service");
354             MethodCache.remove(LayoutService.class);
355         }
356 
357         return _service;
358     }
359 
360     public void setService(LayoutService service) {
361         MethodCache.remove(LayoutService.class);
362 
363         _service = service;
364 
365         ReferenceRegistry.registerReference(LayoutServiceUtil.class, "_service");
366         MethodCache.remove(LayoutService.class);
367     }
368 
369     private static LayoutService _service;
370 }