1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.http;
21  
22  import com.liferay.portal.kernel.log.Log;
23  import com.liferay.portal.kernel.log.LogFactoryUtil;
24  import com.liferay.portal.service.LayoutServiceUtil;
25  
26  import java.rmi.RemoteException;
27  
28  /**
29   * <a href="LayoutServiceSoap.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This class provides a SOAP utility for the
38   * <code>com.liferay.portal.service.LayoutServiceUtil</code> service
39   * utility. The static methods of this class calls the same methods of the
40   * service utility. However, the signatures are different because it is
41   * difficult for SOAP to support certain types.
42   * </p>
43   *
44   * <p>
45   * ServiceBuilder follows certain rules in translating the methods. For example,
46   * if the method in the service utility returns a <code>java.util.List</code>,
47   * that is translated to an array of
48   * <code>com.liferay.portal.model.LayoutSoap</code>. If the method in the
49   * service utility returns a <code>com.liferay.portal.model.Layout</code>,
50   * that is translated to a <code>com.liferay.portal.model.LayoutSoap</code>.
51   * Methods that SOAP cannot safely wire are skipped.
52   * </p>
53   *
54   * <p>
55   * The benefits of using the SOAP utility is that it is cross platform
56   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
57   * even Perl, to call the generated services. One drawback of SOAP is that it is
58   * slow because it needs to serialize all calls into a text format (XML).
59   * </p>
60   *
61   * <p>
62   * You can see a list of services at
63   * http://localhost:8080/tunnel-web/secure/axis. Set the property
64   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
65   * security.
66   * </p>
67   *
68   * <p>
69   * The SOAP utility is only generated for remote services.
70   * </p>
71   *
72   * @author Brian Wing Shun Chan
73   *
74   * @see com.liferay.portal.model.LayoutSoap
75   * @see com.liferay.portal.service.LayoutServiceUtil
76   * @see com.liferay.portal.service.http.LayoutServiceHttp
77   *
78   */
79  public class LayoutServiceSoap {
80      public static com.liferay.portal.model.LayoutSoap addLayout(long groupId,
81          boolean privateLayout, long parentLayoutId, java.lang.String name,
82          java.lang.String title, java.lang.String description,
83          java.lang.String type, boolean hidden, java.lang.String friendlyURL)
84          throws RemoteException {
85          try {
86              com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.addLayout(groupId,
87                      privateLayout, parentLayoutId, name, title, description,
88                      type, hidden, friendlyURL);
89  
90              return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
91          }
92          catch (Exception e) {
93              _log.error(e, e);
94  
95              throw new RemoteException(e.getMessage());
96          }
97      }
98  
99      public static void deleteLayout(long plid) throws RemoteException {
100         try {
101             LayoutServiceUtil.deleteLayout(plid);
102         }
103         catch (Exception e) {
104             _log.error(e, e);
105 
106             throw new RemoteException(e.getMessage());
107         }
108     }
109 
110     public static void deleteLayout(long groupId, boolean privateLayout,
111         long layoutId) throws RemoteException {
112         try {
113             LayoutServiceUtil.deleteLayout(groupId, privateLayout, layoutId);
114         }
115         catch (Exception e) {
116             _log.error(e, e);
117 
118             throw new RemoteException(e.getMessage());
119         }
120     }
121 
122     public static java.lang.String getLayoutName(long groupId,
123         boolean privateLayout, long layoutId, java.lang.String languageId)
124         throws RemoteException {
125         try {
126             java.lang.String returnValue = LayoutServiceUtil.getLayoutName(groupId,
127                     privateLayout, layoutId, languageId);
128 
129             return returnValue;
130         }
131         catch (Exception e) {
132             _log.error(e, e);
133 
134             throw new RemoteException(e.getMessage());
135         }
136     }
137 
138     public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
139         long companyId, java.lang.String portletId, java.lang.String prefsKey,
140         java.lang.String prefsValue) throws RemoteException {
141         try {
142             com.liferay.portal.model.LayoutReference[] returnValue = LayoutServiceUtil.getLayoutReferences(companyId,
143                     portletId, prefsKey, prefsValue);
144 
145             return returnValue;
146         }
147         catch (Exception e) {
148             _log.error(e, e);
149 
150             throw new RemoteException(e.getMessage());
151         }
152     }
153 
154     public static void setLayouts(long groupId, boolean privateLayout,
155         long parentLayoutId, long[] layoutIds) throws RemoteException {
156         try {
157             LayoutServiceUtil.setLayouts(groupId, privateLayout,
158                 parentLayoutId, layoutIds);
159         }
160         catch (Exception e) {
161             _log.error(e, e);
162 
163             throw new RemoteException(e.getMessage());
164         }
165     }
166 
167     public static void unschedulePublishToLive(long groupId,
168         java.lang.String jobName, java.lang.String groupName)
169         throws RemoteException {
170         try {
171             LayoutServiceUtil.unschedulePublishToLive(groupId, jobName,
172                 groupName);
173         }
174         catch (Exception e) {
175             _log.error(e, e);
176 
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static void unschedulePublishToRemote(long groupId,
182         java.lang.String jobName, java.lang.String groupName)
183         throws RemoteException {
184         try {
185             LayoutServiceUtil.unschedulePublishToRemote(groupId, jobName,
186                 groupName);
187         }
188         catch (Exception e) {
189             _log.error(e, e);
190 
191             throw new RemoteException(e.getMessage());
192         }
193     }
194 
195     public static com.liferay.portal.model.LayoutSoap updateLayout(
196         long groupId, boolean privateLayout, long layoutId,
197         java.lang.String typeSettings) throws RemoteException {
198         try {
199             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLayout(groupId,
200                     privateLayout, layoutId, typeSettings);
201 
202             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
203         }
204         catch (Exception e) {
205             _log.error(e, e);
206 
207             throw new RemoteException(e.getMessage());
208         }
209     }
210 
211     public static com.liferay.portal.model.LayoutSoap updateLookAndFeel(
212         long groupId, boolean privateLayout, long layoutId,
213         java.lang.String themeId, java.lang.String colorSchemeId,
214         java.lang.String css, boolean wapTheme) throws RemoteException {
215         try {
216             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLookAndFeel(groupId,
217                     privateLayout, layoutId, themeId, colorSchemeId, css,
218                     wapTheme);
219 
220             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
221         }
222         catch (Exception e) {
223             _log.error(e, e);
224 
225             throw new RemoteException(e.getMessage());
226         }
227     }
228 
229     public static com.liferay.portal.model.LayoutSoap updateName(long plid,
230         java.lang.String name, java.lang.String languageId)
231         throws RemoteException {
232         try {
233             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(plid,
234                     name, languageId);
235 
236             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
237         }
238         catch (Exception e) {
239             _log.error(e, e);
240 
241             throw new RemoteException(e.getMessage());
242         }
243     }
244 
245     public static com.liferay.portal.model.LayoutSoap updateName(long groupId,
246         boolean privateLayout, long layoutId, java.lang.String name,
247         java.lang.String languageId) throws RemoteException {
248         try {
249             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(groupId,
250                     privateLayout, layoutId, name, languageId);
251 
252             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
253         }
254         catch (Exception e) {
255             _log.error(e, e);
256 
257             throw new RemoteException(e.getMessage());
258         }
259     }
260 
261     public static com.liferay.portal.model.LayoutSoap updateParentLayoutId(
262         long plid, long parentPlid) throws RemoteException {
263         try {
264             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(plid,
265                     parentPlid);
266 
267             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
268         }
269         catch (Exception e) {
270             _log.error(e, e);
271 
272             throw new RemoteException(e.getMessage());
273         }
274     }
275 
276     public static com.liferay.portal.model.LayoutSoap updateParentLayoutId(
277         long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
278         throws RemoteException {
279         try {
280             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(groupId,
281                     privateLayout, layoutId, parentLayoutId);
282 
283             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
284         }
285         catch (Exception e) {
286             _log.error(e, e);
287 
288             throw new RemoteException(e.getMessage());
289         }
290     }
291 
292     public static com.liferay.portal.model.LayoutSoap updatePriority(
293         long plid, int priority) throws RemoteException {
294         try {
295             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(plid,
296                     priority);
297 
298             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
299         }
300         catch (Exception e) {
301             _log.error(e, e);
302 
303             throw new RemoteException(e.getMessage());
304         }
305     }
306 
307     public static com.liferay.portal.model.LayoutSoap updatePriority(
308         long groupId, boolean privateLayout, long layoutId, int priority)
309         throws RemoteException {
310         try {
311             com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(groupId,
312                     privateLayout, layoutId, priority);
313 
314             return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
315         }
316         catch (Exception e) {
317             _log.error(e, e);
318 
319             throw new RemoteException(e.getMessage());
320         }
321     }
322 
323     private static Log _log = LogFactoryUtil.getLog(LayoutServiceSoap.class);
324 }