001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.service.LayoutServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * <p>
025     * This class provides a SOAP utility for the
026     * {@link com.liferay.portal.service.LayoutServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it is difficult for SOAP to
029     * support certain types.
030     * </p>
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.LayoutSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Layout}, that is translated to a
038     * {@link com.liferay.portal.model.LayoutSoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at
051     * http://localhost:8080/tunnel-web/secure/axis. Set the property
052     * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
053     * security.
054     * </p>
055     *
056     * <p>
057     * The SOAP utility is only generated for remote services.
058     * </p>
059     *
060     * @author    Brian Wing Shun Chan
061     * @see       LayoutServiceHttp
062     * @see       com.liferay.portal.model.LayoutSoap
063     * @see       com.liferay.portal.service.LayoutServiceUtil
064     * @generated
065     */
066    public class LayoutServiceSoap {
067            /**
068            * Adds a layout with empty maps for descriptions, keywords, and titles ,
069            * and a names map containing a mapping for the default locale as its only
070            * entry.
071            *
072            * <p>
073            * This method handles the creation of the layout including its resources,
074            * metadata, and internal data structures. It is not necessary to make
075            * subsequent calls to any methods to setup default groups, resources, ...
076            * etc.
077            * </p>
078            *
079            * @param groupId the primary key of the group
080            * @param privateLayout whether the layout is private to the group
081            * @param parentLayoutId the primary key of the parent layout (optionally
082            {@link
083            com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID})
084            * @param name Map the layout's locales and localized names
085            * @param title Map the layout's locales and localized titles
086            * @param description Map the layout's locales and localized descriptions
087            * @param type the layout's type (optionally {@link
088            com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The
089            possible types can be found in {@link
090            com.liferay.portal.model.LayoutConstants}.
091            * @param hidden whether the layout is hidden
092            * @param friendlyURL the layout's friendly URL (optionally {@link
093            com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}
094            or {@link
095            com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}).
096            The default values can be overridden in
097            <code>portal-ext.properties</code> by specifying new values for
098            the corresponding properties defined in {@link
099            com.liferay.portal.util.PropsValues}. To see how the URL is
100            normalized when accessed see {@link
101            com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize(
102            String)}.
103            * @param locked whether the layout is locked
104            * @param serviceContext the service context. Must specify the replacement
105            universally unique identifier and can specify the replacement
106            create date, replacement modified date and the new expando
107            bridge attributes.
108            * @return the layout
109            * @throws PortalException if a group with the primary key could not be
110            found, if the group did not have permission to manage the
111            layouts involved, or if layout values were invalid
112            * @throws SystemException if a system exception occurred
113            */
114            public static com.liferay.portal.model.LayoutSoap addLayout(long groupId,
115                    boolean privateLayout, long parentLayoutId, java.lang.String name,
116                    java.lang.String title, java.lang.String description,
117                    java.lang.String type, boolean hidden, java.lang.String friendlyURL,
118                    boolean locked, com.liferay.portal.service.ServiceContext serviceContext)
119                    throws RemoteException {
120                    try {
121                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.addLayout(groupId,
122                                            privateLayout, parentLayoutId, name, title, description,
123                                            type, hidden, friendlyURL, locked, serviceContext);
124    
125                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
126                    }
127                    catch (Exception e) {
128                            _log.error(e, e);
129    
130                            throw new RemoteException(e.getMessage());
131                    }
132            }
133    
134            /**
135            * Deletes the layout with the plid, also deleting the layout's child
136            * layouts, and associated resources.
137            *
138            * @param plid the primary key of the layout
139            * @param serviceContext the service context
140            * @throws PortalException if the user did not have permission to delete
141            the layout, if a layout with the primary key could not be found
142            , or if some other portal exception occurred
143            * @throws SystemException if a system exception occurred
144            */
145            public static void deleteLayout(long plid,
146                    com.liferay.portal.service.ServiceContext serviceContext)
147                    throws RemoteException {
148                    try {
149                            LayoutServiceUtil.deleteLayout(plid, serviceContext);
150                    }
151                    catch (Exception e) {
152                            _log.error(e, e);
153    
154                            throw new RemoteException(e.getMessage());
155                    }
156            }
157    
158            /**
159            * Deletes the layout with the primary key, also deleting the layout's
160            * child layouts, and associated resources.
161            *
162            * @param groupId the primary key of the group
163            * @param privateLayout whether the layout is private to the group
164            * @param layoutId the primary key of the layout
165            * @param serviceContext the service context
166            * @throws PortalException if the user did not have permission to delete
167            the layout, if a matching layout could not be found , or if some
168            other portal exception occurred
169            * @throws SystemException if a system exception occurred
170            */
171            public static void deleteLayout(long groupId, boolean privateLayout,
172                    long layoutId, com.liferay.portal.service.ServiceContext serviceContext)
173                    throws RemoteException {
174                    try {
175                            LayoutServiceUtil.deleteLayout(groupId, privateLayout, layoutId,
176                                    serviceContext);
177                    }
178                    catch (Exception e) {
179                            _log.error(e, e);
180    
181                            throw new RemoteException(e.getMessage());
182                    }
183            }
184    
185            /**
186            * Returns the primary key of the default layout for the group.
187            *
188            * @param groupId the primary key of the group
189            * @param scopeGroupId the primary key of the scope group. See {@link
190            ServiceContext#getScopeGroupId()}.
191            * @param privateLayout whether the layout is private to the group
192            * @param portletId the primary key of the portlet
193            * @return Returns the primary key of the default layout group; {@link
194            com.liferay.portal.model.LayoutConstants#DEFAULT_PLID} otherwise
195            * @throws PortalException if a group, layout, or portlet with the primary
196            key could not be found
197            * @throws SystemException if a system exception occurred
198            */
199            public static long getDefaultPlid(long groupId, long scopeGroupId,
200                    boolean privateLayout, java.lang.String portletId)
201                    throws RemoteException {
202                    try {
203                            long returnValue = LayoutServiceUtil.getDefaultPlid(groupId,
204                                            scopeGroupId, privateLayout, portletId);
205    
206                            return returnValue;
207                    }
208                    catch (Exception e) {
209                            _log.error(e, e);
210    
211                            throw new RemoteException(e.getMessage());
212                    }
213            }
214    
215            /**
216            * Returns the name of the layout.
217            *
218            * @param groupId the primary key of the group
219            * @param privateLayout whether the layout is private to the group
220            * @param layoutId the primary key of the layout
221            * @param languageId the primary key of the language. For more information
222            See {@link java.util.Locale}.
223            * @return the layout's name
224            * @throws PortalException if a matching layout could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static java.lang.String getLayoutName(long groupId,
228                    boolean privateLayout, long layoutId, java.lang.String languageId)
229                    throws RemoteException {
230                    try {
231                            java.lang.String returnValue = LayoutServiceUtil.getLayoutName(groupId,
232                                            privateLayout, layoutId, languageId);
233    
234                            return returnValue;
235                    }
236                    catch (Exception e) {
237                            _log.error(e, e);
238    
239                            throw new RemoteException(e.getMessage());
240                    }
241            }
242    
243            /**
244            * Returns the layout references for all the layouts that belong to the
245            * company and belong to the portlet that matches the preferences.
246            *
247            * @param companyId the primary key of the company
248            * @param portletId the primary key of the portlet
249            * @param preferencesKey the portlet's preference key
250            * @param preferencesValue the portlet's preference value
251            * @return the layout references of the matching layouts
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.LayoutReference[] getLayoutReferences(
255                    long companyId, java.lang.String portletId,
256                    java.lang.String preferencesKey, java.lang.String preferencesValue)
257                    throws RemoteException {
258                    try {
259                            com.liferay.portal.model.LayoutReference[] returnValue = LayoutServiceUtil.getLayoutReferences(companyId,
260                                            portletId, preferencesKey, preferencesValue);
261    
262                            return returnValue;
263                    }
264                    catch (Exception e) {
265                            _log.error(e, e);
266    
267                            throw new RemoteException(e.getMessage());
268                    }
269            }
270    
271            /**
272            * Sets the layouts for the group, replacing and prioritizing all layouts
273            * of the parent layout.
274            *
275            * @param groupId the primary key of the group
276            * @param privateLayout whether the layout is private to the group
277            * @param parentLayoutId the primary key of the parent layout
278            * @param layoutIds the primary keys of the layouts
279            * @param serviceContext the service context
280            * @throws PortalException if a group or layout with the primary key could
281            not be found, if the group did not have permission to manage the
282            layouts, if no layouts were specified, if the first layout was
283            not page-able, if the first layout was hidden, or if some other
284            portal exception occurred
285            * @throws SystemException if a system exception occurred
286            */
287            public static void setLayouts(long groupId, boolean privateLayout,
288                    long parentLayoutId, long[] layoutIds,
289                    com.liferay.portal.service.ServiceContext serviceContext)
290                    throws RemoteException {
291                    try {
292                            LayoutServiceUtil.setLayouts(groupId, privateLayout,
293                                    parentLayoutId, layoutIds, serviceContext);
294                    }
295                    catch (Exception e) {
296                            _log.error(e, e);
297    
298                            throw new RemoteException(e.getMessage());
299                    }
300            }
301    
302            /**
303            * Deletes the job from the scheduler's queue.
304            *
305            * @param groupId the primary key of the group
306            * @param jobName the job name
307            * @param groupName the group name (optionally {@link
308            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
309            See {@link
310            com.liferay.portal.kernel.messaging.DestinationNames}.
311            * @throws PortalException if the group did not permission to manage
312            staging and publish
313            * @throws SystemException if a system exception occurred
314            */
315            public static void unschedulePublishToLive(long groupId,
316                    java.lang.String jobName, java.lang.String groupName)
317                    throws RemoteException {
318                    try {
319                            LayoutServiceUtil.unschedulePublishToLive(groupId, jobName,
320                                    groupName);
321                    }
322                    catch (Exception e) {
323                            _log.error(e, e);
324    
325                            throw new RemoteException(e.getMessage());
326                    }
327            }
328    
329            /**
330            * Deletes the job from the scheduler's persistent queue.
331            *
332            * @param groupId the primary key of the group
333            * @param jobName the job name
334            * @param groupName the group name (optionally {@link
335            com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}).
336            See {@link
337            com.liferay.portal.kernel.messaging.DestinationNames}.
338            * @throws PortalException if a group with the primary key could not be
339            found or if the group did not have permission to publish
340            * @throws SystemException if a system exception occurred
341            */
342            public static void unschedulePublishToRemote(long groupId,
343                    java.lang.String jobName, java.lang.String groupName)
344                    throws RemoteException {
345                    try {
346                            LayoutServiceUtil.unschedulePublishToRemote(groupId, jobName,
347                                    groupName);
348                    }
349                    catch (Exception e) {
350                            _log.error(e, e);
351    
352                            throw new RemoteException(e.getMessage());
353                    }
354            }
355    
356            /**
357            * Updates the layout replacing its type settings.
358            *
359            * @param groupId the primary key of the group
360            * @param privateLayout whether the layout is private to the group
361            * @param layoutId the primary key of the layout
362            * @param typeSettings the settings to load the unicode properties object.
363            See {@link com.liferay.portal.kernel.util.UnicodeProperties
364            #fastLoad(String)}.
365            * @return the updated layout
366            * @throws PortalException if a matching layout could not be found or if
367            the user did not have permission to update the layout
368            * @throws SystemException if a system exception occurred
369            */
370            public static com.liferay.portal.model.LayoutSoap updateLayout(
371                    long groupId, boolean privateLayout, long layoutId,
372                    java.lang.String typeSettings) throws RemoteException {
373                    try {
374                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLayout(groupId,
375                                            privateLayout, layoutId, typeSettings);
376    
377                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
378                    }
379                    catch (Exception e) {
380                            _log.error(e, e);
381    
382                            throw new RemoteException(e.getMessage());
383                    }
384            }
385    
386            /**
387            * Updates the look and feel of the layout.
388            *
389            * @param groupId the primary key of the group
390            * @param privateLayout whether the layout is private to the group
391            * @param layoutId the primary key of the layout
392            * @param themeId the primary key of the layout's new theme
393            * @param colorSchemeId the primary key of the layout's new color scheme
394            * @param css the layout's new CSS
395            * @param wapTheme whether the theme is for WAP browsers
396            * @return the updated layout
397            * @throws PortalException if a matching layout could not be found, or if
398            the user did not have permission to update the layout and
399            permission to apply the theme
400            * @throws SystemException if a system exception occurred
401            */
402            public static com.liferay.portal.model.LayoutSoap updateLookAndFeel(
403                    long groupId, boolean privateLayout, long layoutId,
404                    java.lang.String themeId, java.lang.String colorSchemeId,
405                    java.lang.String css, boolean wapTheme) throws RemoteException {
406                    try {
407                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLookAndFeel(groupId,
408                                            privateLayout, layoutId, themeId, colorSchemeId, css,
409                                            wapTheme);
410    
411                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
412                    }
413                    catch (Exception e) {
414                            _log.error(e, e);
415    
416                            throw new RemoteException(e.getMessage());
417                    }
418            }
419    
420            /**
421            * Updates the name of the layout matching the group, layout ID, and
422            * privacy.
423            *
424            * @param groupId the primary key of the group
425            * @param privateLayout whether the layout is private to the group
426            * @param layoutId the primary key of the layout
427            * @param name the layout's new name
428            * @param languageId the primary key of the language. For more information
429            see {@link java.util.Locale}.
430            * @return the updated layout
431            * @throws PortalException if a matching layout could not be found, if the
432            user did not have permission to update the layout, or if the new
433            name was <code>null</code>
434            * @throws SystemException if a system exception occurred
435            */
436            public static com.liferay.portal.model.LayoutSoap updateName(long groupId,
437                    boolean privateLayout, long layoutId, java.lang.String name,
438                    java.lang.String languageId) throws RemoteException {
439                    try {
440                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(groupId,
441                                            privateLayout, layoutId, name, languageId);
442    
443                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
444                    }
445                    catch (Exception e) {
446                            _log.error(e, e);
447    
448                            throw new RemoteException(e.getMessage());
449                    }
450            }
451    
452            /**
453            * Updates the name of the layout matching the primary key.
454            *
455            * @param plid the primary key of the layout
456            * @param name the name to be assigned
457            * @param languageId the primary key of the language. For more information
458            see {@link java.util.Locale}.
459            * @return the updated layout
460            * @throws PortalException if a layout with the primary key could not be
461            found, or if the user did not have permission to update the
462            layout, or if the name was <code>null</code>
463            * @throws SystemException if a system exception occurred
464            */
465            public static com.liferay.portal.model.LayoutSoap updateName(long plid,
466                    java.lang.String name, java.lang.String languageId)
467                    throws RemoteException {
468                    try {
469                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(plid,
470                                            name, languageId);
471    
472                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
473                    }
474                    catch (Exception e) {
475                            _log.error(e, e);
476    
477                            throw new RemoteException(e.getMessage());
478                    }
479            }
480    
481            /**
482            * Updates the parent layout ID of the layout matching the group, layout
483            * ID, and privacy.
484            *
485            * @param groupId the primary key of the group
486            * @param privateLayout whether the layout is private to the group
487            * @param layoutId the primary key of the layout
488            * @param parentLayoutId the primary key to be assigned to the parent
489            layout
490            * @return the matching layout
491            * @throws PortalException if a valid parent layout ID to use could not be
492            found, if a matching layout could not be found, or if the user
493            did not have permission to update the layout
494            * @throws SystemException if a system exception occurred
495            */
496            public static com.liferay.portal.model.LayoutSoap updateParentLayoutId(
497                    long groupId, boolean privateLayout, long layoutId, long parentLayoutId)
498                    throws RemoteException {
499                    try {
500                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(groupId,
501                                            privateLayout, layoutId, parentLayoutId);
502    
503                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
504                    }
505                    catch (Exception e) {
506                            _log.error(e, e);
507    
508                            throw new RemoteException(e.getMessage());
509                    }
510            }
511    
512            /**
513            * Updates the parent layout ID of the layout matching the primary key. If
514            * a layout matching the parent primary key is found, the layout ID of that
515            * layout is assigned, otherwise {@link
516            * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is
517            * assigned.
518            *
519            * @param plid the primary key of the layout
520            * @param parentPlid the primary key of the parent layout
521            * @return the layout matching the primary key
522            * @throws PortalException if a layout with the primary key could not be
523            found, if the user did not have permission to update the layout,
524            or if a valid parent layout ID to use could not be found
525            * @throws SystemException if a system exception occurred
526            */
527            public static com.liferay.portal.model.LayoutSoap updateParentLayoutId(
528                    long plid, long parentPlid) throws RemoteException {
529                    try {
530                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(plid,
531                                            parentPlid);
532    
533                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
534                    }
535                    catch (Exception e) {
536                            _log.error(e, e);
537    
538                            throw new RemoteException(e.getMessage());
539                    }
540            }
541    
542            /**
543            * Updates the priority of the layout matching the group, layout ID, and
544            * privacy.
545            *
546            * @param groupId the primary key of the group
547            * @param privateLayout whether the layout is private to the group
548            * @param layoutId the primary key of the layout
549            * @param priority the layout's new priority
550            * @return the updated layout
551            * @throws PortalException if a matching layout could not be found or if
552            the user did not have permission to update the layout
553            * @throws SystemException if a system exception occurred
554            */
555            public static com.liferay.portal.model.LayoutSoap updatePriority(
556                    long groupId, boolean privateLayout, long layoutId, int priority)
557                    throws RemoteException {
558                    try {
559                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(groupId,
560                                            privateLayout, layoutId, priority);
561    
562                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
563                    }
564                    catch (Exception e) {
565                            _log.error(e, e);
566    
567                            throw new RemoteException(e.getMessage());
568                    }
569            }
570    
571            /**
572            * Updates the priority of the layout matching the primary key.
573            *
574            * @param plid the primary key of the layout
575            * @param priority the layout's new priority
576            * @return the updated layout
577            * @throws PortalException if a layout with the primary key could not be
578            found
579            * @throws SystemException if a system exception occurred
580            */
581            public static com.liferay.portal.model.LayoutSoap updatePriority(
582                    long plid, int priority) throws RemoteException {
583                    try {
584                            com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(plid,
585                                            priority);
586    
587                            return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue);
588                    }
589                    catch (Exception e) {
590                            _log.error(e, e);
591    
592                            throw new RemoteException(e.getMessage());
593                    }
594            }
595    
596            private static Log _log = LogFactoryUtil.getLog(LayoutServiceSoap.class);
597    }