1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  
26  /**
27   * <a href="LayoutServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.LayoutService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portal.service.LayoutService
45   *
46   */
47  public class LayoutServiceUtil {
48      public static com.liferay.portal.model.Layout addLayout(long groupId,
49          boolean privateLayout, long parentLayoutId, java.lang.String name,
50          java.lang.String title, java.lang.String description,
51          java.lang.String type, boolean hidden, java.lang.String friendlyURL)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException, java.rmi.RemoteException {
54          return getService()
55                     .addLayout(groupId, privateLayout, parentLayoutId, name,
56              title, description, type, hidden, friendlyURL);
57      }
58  
59      public static com.liferay.portal.model.Layout addLayout(long groupId,
60          boolean privateLayout, long parentLayoutId,
61          java.util.Map<java.util.Locale, String> localeNamesMap,
62          java.util.Map<java.util.Locale, String> localeTitlesMap,
63          java.lang.String description, java.lang.String type, boolean hidden,
64          java.lang.String friendlyURL)
65          throws com.liferay.portal.PortalException,
66              com.liferay.portal.SystemException, java.rmi.RemoteException {
67          return getService()
68                     .addLayout(groupId, privateLayout, parentLayoutId,
69              localeNamesMap, localeTitlesMap, description, type, hidden,
70              friendlyURL);
71      }
72  
73      public static void deleteLayout(long plid)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException, java.rmi.RemoteException {
76          getService().deleteLayout(plid);
77      }
78  
79      public static void deleteLayout(long groupId, boolean privateLayout,
80          long layoutId)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException, java.rmi.RemoteException {
83          getService().deleteLayout(groupId, privateLayout, layoutId);
84      }
85  
86      public static java.lang.String getLayoutName(long groupId,
87          boolean privateLayout, long layoutId, java.lang.String languageId)
88          throws com.liferay.portal.PortalException,
89              com.liferay.portal.SystemException, java.rmi.RemoteException {
90          return getService()
91                     .getLayoutName(groupId, privateLayout, layoutId, languageId);
92      }
93  
94      public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
95          long companyId, java.lang.String portletId, java.lang.String prefsKey,
96          java.lang.String prefsValue)
97          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
98          return getService()
99                     .getLayoutReferences(companyId, portletId, prefsKey,
100             prefsValue);
101     }
102 
103     public static byte[] exportLayouts(long groupId, boolean privateLayout,
104         java.util.Map<String, String[]> parameterMap, java.util.Date startDate,
105         java.util.Date endDate)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException, java.rmi.RemoteException {
108         return getService()
109                    .exportLayouts(groupId, privateLayout, parameterMap,
110             startDate, endDate);
111     }
112 
113     public static byte[] exportLayouts(long groupId, boolean privateLayout,
114         long[] layoutIds, java.util.Map<String, String[]> parameterMap,
115         java.util.Date startDate, java.util.Date endDate)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException, java.rmi.RemoteException {
118         return getService()
119                    .exportLayouts(groupId, privateLayout, layoutIds,
120             parameterMap, startDate, endDate);
121     }
122 
123     public static com.liferay.portal.kernel.io.FileCacheOutputStream exportLayoutsAsStream(
124         long groupId, boolean privateLayout, long[] layoutIds,
125         java.util.Map<String, String[]> parameterMap, java.util.Date startDate,
126         java.util.Date endDate)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException, java.rmi.RemoteException {
129         return getService()
130                    .exportLayoutsAsStream(groupId, privateLayout, layoutIds,
131             parameterMap, startDate, endDate);
132     }
133 
134     public static byte[] exportPortletInfo(long plid,
135         java.lang.String portletId,
136         java.util.Map<String, String[]> parameterMap, java.util.Date startDate,
137         java.util.Date endDate)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException, java.rmi.RemoteException {
140         return getService()
141                    .exportPortletInfo(plid, portletId, parameterMap, startDate,
142             endDate);
143     }
144 
145     public static com.liferay.portal.kernel.io.FileCacheOutputStream exportPortletInfoAsStream(
146         long plid, java.lang.String portletId,
147         java.util.Map<String, String[]> parameterMap, java.util.Date startDate,
148         java.util.Date endDate)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException, java.rmi.RemoteException {
151         return getService()
152                    .exportPortletInfoAsStream(plid, portletId, parameterMap,
153             startDate, endDate);
154     }
155 
156     public static void importLayouts(long groupId, boolean privateLayout,
157         java.util.Map<String, String[]> parameterMap, java.io.File file)
158         throws com.liferay.portal.PortalException,
159             com.liferay.portal.SystemException, java.rmi.RemoteException {
160         getService().importLayouts(groupId, privateLayout, parameterMap, file);
161     }
162 
163     public static void importLayouts(long groupId, boolean privateLayout,
164         java.util.Map<String, String[]> parameterMap, byte[] bytes)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException, java.rmi.RemoteException {
167         getService().importLayouts(groupId, privateLayout, parameterMap, bytes);
168     }
169 
170     public static void importLayouts(long groupId, boolean privateLayout,
171         java.util.Map<String, String[]> parameterMap, java.io.InputStream is)
172         throws com.liferay.portal.PortalException,
173             com.liferay.portal.SystemException, java.rmi.RemoteException {
174         getService().importLayouts(groupId, privateLayout, parameterMap, is);
175     }
176 
177     public static void importPortletInfo(long plid, java.lang.String portletId,
178         java.util.Map<String, String[]> parameterMap, java.io.File file)
179         throws com.liferay.portal.PortalException,
180             com.liferay.portal.SystemException, java.rmi.RemoteException {
181         getService().importPortletInfo(plid, portletId, parameterMap, file);
182     }
183 
184     public static void importPortletInfo(long plid, java.lang.String portletId,
185         java.util.Map<String, String[]> parameterMap, java.io.InputStream is)
186         throws com.liferay.portal.PortalException,
187             com.liferay.portal.SystemException, java.rmi.RemoteException {
188         getService().importPortletInfo(plid, portletId, parameterMap, is);
189     }
190 
191     public static void schedulePublishToLive(long sourceGroupId,
192         long targetGroupId, boolean privateLayout,
193         java.util.Map<Long, Boolean> layoutIdMap,
194         java.util.Map<String, String[]> parameterMap, java.lang.String scope,
195         java.util.Date startDate, java.util.Date endDate,
196         java.lang.String groupName, java.lang.String cronText,
197         java.util.Date schedulerStartDate, java.util.Date schedulerEndDate,
198         java.lang.String description)
199         throws com.liferay.portal.PortalException,
200             com.liferay.portal.SystemException, java.rmi.RemoteException {
201         getService()
202             .schedulePublishToLive(sourceGroupId, targetGroupId, privateLayout,
203             layoutIdMap, parameterMap, scope, startDate, endDate, groupName,
204             cronText, schedulerStartDate, schedulerEndDate, description);
205     }
206 
207     public static void schedulePublishToRemote(long sourceGroupId,
208         boolean privateLayout, java.util.Map<Long, Boolean> layoutIdMap,
209         java.util.Map<String, String[]> parameterMap,
210         java.lang.String remoteAddress, int remotePort,
211         boolean secureConnection, long remoteGroupId,
212         boolean remotePrivateLayout, java.util.Date startDate,
213         java.util.Date endDate, java.lang.String groupName,
214         java.lang.String cronText, java.util.Date schedulerStartDate,
215         java.util.Date schedulerEndDate, java.lang.String description)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException, java.rmi.RemoteException {
218         getService()
219             .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap,
220             parameterMap, remoteAddress, remotePort, secureConnection,
221             remoteGroupId, remotePrivateLayout, startDate, endDate, groupName,
222             cronText, schedulerStartDate, schedulerEndDate, description);
223     }
224 
225     public static void setLayouts(long groupId, boolean privateLayout,
226         long parentLayoutId, long[] layoutIds)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException, java.rmi.RemoteException {
229         getService()
230             .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds);
231     }
232 
233     public static void unschedulePublishToLive(long groupId,
234         java.lang.String jobName, java.lang.String groupName)
235         throws com.liferay.portal.PortalException,
236             com.liferay.portal.SystemException, java.rmi.RemoteException {
237         getService().unschedulePublishToLive(groupId, jobName, groupName);
238     }
239 
240     public static void unschedulePublishToRemote(long groupId,
241         java.lang.String jobName, java.lang.String groupName)
242         throws com.liferay.portal.PortalException,
243             com.liferay.portal.SystemException, java.rmi.RemoteException {
244         getService().unschedulePublishToRemote(groupId, jobName, groupName);
245     }
246 
247     public static com.liferay.portal.model.Layout updateLayout(long groupId,
248         boolean privateLayout, long layoutId, long parentLayoutId,
249         java.util.Map<java.util.Locale, String> localeNamesMap,
250         java.util.Map<java.util.Locale, String> localeTitlesMap,
251         java.lang.String description, java.lang.String type, boolean hidden,
252         java.lang.String friendlyURL)
253         throws com.liferay.portal.PortalException,
254             com.liferay.portal.SystemException, java.rmi.RemoteException {
255         return getService()
256                    .updateLayout(groupId, privateLayout, layoutId,
257             parentLayoutId, localeNamesMap, localeTitlesMap, description, type,
258             hidden, friendlyURL);
259     }
260 
261     public static com.liferay.portal.model.Layout updateLayout(long groupId,
262         boolean privateLayout, long layoutId, long parentLayoutId,
263         java.util.Map<java.util.Locale, String> localeNamesMap,
264         java.util.Map<java.util.Locale, String> localeTitlesMap,
265         java.lang.String description, java.lang.String type, boolean hidden,
266         java.lang.String friendlyURL, java.lang.Boolean iconImage,
267         byte[] iconBytes)
268         throws com.liferay.portal.PortalException,
269             com.liferay.portal.SystemException, java.rmi.RemoteException {
270         return getService()
271                    .updateLayout(groupId, privateLayout, layoutId,
272             parentLayoutId, localeNamesMap, localeTitlesMap, description, type,
273             hidden, friendlyURL, iconImage, iconBytes);
274     }
275 
276     public static com.liferay.portal.model.Layout updateLayout(long groupId,
277         boolean privateLayout, long layoutId, java.lang.String typeSettings)
278         throws com.liferay.portal.PortalException,
279             com.liferay.portal.SystemException, java.rmi.RemoteException {
280         return getService()
281                    .updateLayout(groupId, privateLayout, layoutId, typeSettings);
282     }
283 
284     public static com.liferay.portal.model.Layout updateLookAndFeel(
285         long groupId, boolean privateLayout, long layoutId,
286         java.lang.String themeId, java.lang.String colorSchemeId,
287         java.lang.String css, boolean wapTheme)
288         throws com.liferay.portal.PortalException,
289             com.liferay.portal.SystemException, java.rmi.RemoteException {
290         return getService()
291                    .updateLookAndFeel(groupId, privateLayout, layoutId,
292             themeId, colorSchemeId, css, wapTheme);
293     }
294 
295     public static com.liferay.portal.model.Layout updateName(long plid,
296         java.lang.String name, java.lang.String languageId)
297         throws com.liferay.portal.PortalException,
298             com.liferay.portal.SystemException, java.rmi.RemoteException {
299         return getService().updateName(plid, name, languageId);
300     }
301 
302     public static com.liferay.portal.model.Layout updateName(long groupId,
303         boolean privateLayout, long layoutId, java.lang.String name,
304         java.lang.String languageId)
305         throws com.liferay.portal.PortalException,
306             com.liferay.portal.SystemException, java.rmi.RemoteException {
307         return getService()
308                    .updateName(groupId, privateLayout, layoutId, name,
309             languageId);
310     }
311 
312     public static com.liferay.portal.model.Layout updateParentLayoutId(
313         long plid, long parentPlid)
314         throws com.liferay.portal.PortalException,
315             com.liferay.portal.SystemException, java.rmi.RemoteException {
316         return getService().updateParentLayoutId(plid, parentPlid);
317     }
318 
319     public static com.liferay.portal.model.Layout updateParentLayoutId(
320         long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
321         throws com.liferay.portal.PortalException,
322             com.liferay.portal.SystemException, java.rmi.RemoteException {
323         return getService()
324                    .updateParentLayoutId(groupId, privateLayout, layoutId,
325             parentLayoutId);
326     }
327 
328     public static com.liferay.portal.model.Layout updatePriority(long plid,
329         int priority)
330         throws com.liferay.portal.PortalException,
331             com.liferay.portal.SystemException, java.rmi.RemoteException {
332         return getService().updatePriority(plid, priority);
333     }
334 
335     public static com.liferay.portal.model.Layout updatePriority(long groupId,
336         boolean privateLayout, long layoutId, int priority)
337         throws com.liferay.portal.PortalException,
338             com.liferay.portal.SystemException, java.rmi.RemoteException {
339         return getService()
340                    .updatePriority(groupId, privateLayout, layoutId, priority);
341     }
342 
343     public static LayoutService getService() {
344         if (_service == null) {
345             throw new RuntimeException("LayoutService is not set");
346         }
347 
348         return _service;
349     }
350 
351     public void setService(LayoutService service) {
352         _service = service;
353     }
354 
355     private static LayoutService _service;
356 }