001 /** 002 * Copyright (c) 2000-2012 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.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/api/secure/axis. Set the property 052 * <b>axis.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 serviceContext the service context. Must set the universally 104 unique identifier (UUID) for the layout. Can specify the creation 105 date, modification date and the expando bridge attributes for the 106 layout. For layouts that belong to a layout set prototype, an 107 attribute named 'layoutUpdateable' can be used to specify whether 108 site administrators can modify this page within their site. 109 * @return the layout 110 * @throws PortalException if a group with the primary key could not be 111 found, if the group did not have permission to manage the layouts 112 involved, or if layout values were invalid 113 * @throws SystemException if a system exception occurred 114 */ 115 public static com.liferay.portal.model.LayoutSoap addLayout(long groupId, 116 boolean privateLayout, long parentLayoutId, java.lang.String name, 117 java.lang.String title, java.lang.String description, 118 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 119 com.liferay.portal.service.ServiceContext serviceContext) 120 throws RemoteException { 121 try { 122 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.addLayout(groupId, 123 privateLayout, parentLayoutId, name, title, description, 124 type, hidden, friendlyURL, serviceContext); 125 126 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 127 } 128 catch (Exception e) { 129 _log.error(e, e); 130 131 throw new RemoteException(e.getMessage()); 132 } 133 } 134 135 /** 136 * Deletes the layout with the plid, also deleting the layout's child 137 * layouts, and associated resources. 138 * 139 * @param plid the primary key of the layout 140 * @param serviceContext the service context 141 * @throws PortalException if the user did not have permission to delete the 142 layout, if a layout with the primary key could not be found , or 143 if some other portal exception occurred 144 * @throws SystemException if a system exception occurred 145 */ 146 public static void deleteLayout(long plid, 147 com.liferay.portal.service.ServiceContext serviceContext) 148 throws RemoteException { 149 try { 150 LayoutServiceUtil.deleteLayout(plid, serviceContext); 151 } 152 catch (Exception e) { 153 _log.error(e, e); 154 155 throw new RemoteException(e.getMessage()); 156 } 157 } 158 159 /** 160 * Deletes the layout with the primary key, also deleting the layout's child 161 * layouts, and associated resources. 162 * 163 * @param groupId the primary key of the group 164 * @param privateLayout whether the layout is private to the group 165 * @param layoutId the primary key of the layout 166 * @param serviceContext the service context 167 * @throws PortalException if the user did not have permission to delete the 168 layout, if a matching layout could not be found , or if some 169 other portal exception occurred 170 * @throws SystemException if a system exception occurred 171 */ 172 public static void deleteLayout(long groupId, boolean privateLayout, 173 long layoutId, com.liferay.portal.service.ServiceContext serviceContext) 174 throws RemoteException { 175 try { 176 LayoutServiceUtil.deleteLayout(groupId, privateLayout, layoutId, 177 serviceContext); 178 } 179 catch (Exception e) { 180 _log.error(e, e); 181 182 throw new RemoteException(e.getMessage()); 183 } 184 } 185 186 /** 187 * Returns the primary key of the default layout for the group. 188 * 189 * @param groupId the primary key of the group 190 * @param scopeGroupId the primary key of the scope group. See {@link 191 ServiceContext#getScopeGroupId()}. 192 * @param privateLayout whether the layout is private to the group 193 * @param portletId the primary key of the portlet 194 * @return Returns the primary key of the default layout group; {@link 195 com.liferay.portal.model.LayoutConstants#DEFAULT_PLID} otherwise 196 * @throws PortalException if a group, layout, or portlet with the primary 197 key could not be found 198 * @throws SystemException if a system exception occurred 199 */ 200 public static long getDefaultPlid(long groupId, long scopeGroupId, 201 boolean privateLayout, java.lang.String portletId) 202 throws RemoteException { 203 try { 204 long returnValue = LayoutServiceUtil.getDefaultPlid(groupId, 205 scopeGroupId, privateLayout, portletId); 206 207 return returnValue; 208 } 209 catch (Exception e) { 210 _log.error(e, e); 211 212 throw new RemoteException(e.getMessage()); 213 } 214 } 215 216 /** 217 * Returns the name of the layout. 218 * 219 * @param groupId the primary key of the group 220 * @param privateLayout whether the layout is private to the group 221 * @param layoutId the primary key of the layout 222 * @param languageId the primary key of the language. For more information 223 See {@link java.util.Locale}. 224 * @return the layout's name 225 * @throws PortalException if a matching layout could not be found 226 * @throws SystemException if a system exception occurred 227 */ 228 public static java.lang.String getLayoutName(long groupId, 229 boolean privateLayout, long layoutId, java.lang.String languageId) 230 throws RemoteException { 231 try { 232 java.lang.String returnValue = LayoutServiceUtil.getLayoutName(groupId, 233 privateLayout, layoutId, languageId); 234 235 return returnValue; 236 } 237 catch (Exception e) { 238 _log.error(e, e); 239 240 throw new RemoteException(e.getMessage()); 241 } 242 } 243 244 /** 245 * Returns the layout references for all the layouts that belong to the 246 * company and belong to the portlet that matches the preferences. 247 * 248 * @param companyId the primary key of the company 249 * @param portletId the primary key of the portlet 250 * @param preferencesKey the portlet's preference key 251 * @param preferencesValue the portlet's preference value 252 * @return the layout references of the matching layouts 253 * @throws SystemException if a system exception occurred 254 */ 255 public static com.liferay.portal.model.LayoutReference[] getLayoutReferences( 256 long companyId, java.lang.String portletId, 257 java.lang.String preferencesKey, java.lang.String preferencesValue) 258 throws RemoteException { 259 try { 260 com.liferay.portal.model.LayoutReference[] returnValue = LayoutServiceUtil.getLayoutReferences(companyId, 261 portletId, preferencesKey, preferencesValue); 262 263 return returnValue; 264 } 265 catch (Exception e) { 266 _log.error(e, e); 267 268 throw new RemoteException(e.getMessage()); 269 } 270 } 271 272 public static com.liferay.portal.model.LayoutSoap[] getLayouts( 273 long groupId, boolean privateLayout) throws RemoteException { 274 try { 275 java.util.List<com.liferay.portal.model.Layout> returnValue = LayoutServiceUtil.getLayouts(groupId, 276 privateLayout); 277 278 return com.liferay.portal.model.LayoutSoap.toSoapModels(returnValue); 279 } 280 catch (Exception e) { 281 _log.error(e, e); 282 283 throw new RemoteException(e.getMessage()); 284 } 285 } 286 287 /** 288 * Sets the layouts for the group, replacing and prioritizing all layouts of 289 * the parent layout. 290 * 291 * @param groupId the primary key of the group 292 * @param privateLayout whether the layout is private to the group 293 * @param parentLayoutId the primary key of the parent layout 294 * @param layoutIds the primary keys of the layouts 295 * @param serviceContext the service context 296 * @throws PortalException if a group or layout with the primary key could 297 not be found, if the group did not have permission to manage the 298 layouts, if no layouts were specified, if the first layout was 299 not page-able, if the first layout was hidden, or if some other 300 portal exception occurred 301 * @throws SystemException if a system exception occurred 302 */ 303 public static void setLayouts(long groupId, boolean privateLayout, 304 long parentLayoutId, long[] layoutIds, 305 com.liferay.portal.service.ServiceContext serviceContext) 306 throws RemoteException { 307 try { 308 LayoutServiceUtil.setLayouts(groupId, privateLayout, 309 parentLayoutId, layoutIds, serviceContext); 310 } 311 catch (Exception e) { 312 _log.error(e, e); 313 314 throw new RemoteException(e.getMessage()); 315 } 316 } 317 318 /** 319 * Deletes the job from the scheduler's queue. 320 * 321 * @param groupId the primary key of the group 322 * @param jobName the job name 323 * @param groupName the group name (optionally {@link 324 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 325 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 326 * @throws PortalException if the group did not permission to manage staging 327 and publish 328 * @throws SystemException if a system exception occurred 329 */ 330 public static void unschedulePublishToLive(long groupId, 331 java.lang.String jobName, java.lang.String groupName) 332 throws RemoteException { 333 try { 334 LayoutServiceUtil.unschedulePublishToLive(groupId, jobName, 335 groupName); 336 } 337 catch (Exception e) { 338 _log.error(e, e); 339 340 throw new RemoteException(e.getMessage()); 341 } 342 } 343 344 /** 345 * Deletes the job from the scheduler's persistent queue. 346 * 347 * @param groupId the primary key of the group 348 * @param jobName the job name 349 * @param groupName the group name (optionally {@link 350 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 351 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 352 * @throws PortalException if a group with the primary key could not be 353 found or if the group did not have permission to publish 354 * @throws SystemException if a system exception occurred 355 */ 356 public static void unschedulePublishToRemote(long groupId, 357 java.lang.String jobName, java.lang.String groupName) 358 throws RemoteException { 359 try { 360 LayoutServiceUtil.unschedulePublishToRemote(groupId, jobName, 361 groupName); 362 } 363 catch (Exception e) { 364 _log.error(e, e); 365 366 throw new RemoteException(e.getMessage()); 367 } 368 } 369 370 /** 371 * Updates the layout replacing its type settings. 372 * 373 * @param groupId the primary key of the group 374 * @param privateLayout whether the layout is private to the group 375 * @param layoutId the primary key of the layout 376 * @param typeSettings the settings to load the unicode properties object. 377 See {@link com.liferay.portal.kernel.util.UnicodeProperties 378 #fastLoad(String)}. 379 * @return the updated layout 380 * @throws PortalException if a matching layout could not be found or if the 381 user did not have permission to update the layout 382 * @throws SystemException if a system exception occurred 383 */ 384 public static com.liferay.portal.model.LayoutSoap updateLayout( 385 long groupId, boolean privateLayout, long layoutId, 386 java.lang.String typeSettings) throws RemoteException { 387 try { 388 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLayout(groupId, 389 privateLayout, layoutId, typeSettings); 390 391 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 392 } 393 catch (Exception e) { 394 _log.error(e, e); 395 396 throw new RemoteException(e.getMessage()); 397 } 398 } 399 400 /** 401 * Updates the look and feel of the layout. 402 * 403 * @param groupId the primary key of the group 404 * @param privateLayout whether the layout is private to the group 405 * @param layoutId the primary key of the layout 406 * @param themeId the primary key of the layout's new theme 407 * @param colorSchemeId the primary key of the layout's new color scheme 408 * @param css the layout's new CSS 409 * @param wapTheme whether the theme is for WAP browsers 410 * @return the updated layout 411 * @throws PortalException if a matching layout could not be found, or if 412 the user did not have permission to update the layout and 413 permission to apply the theme 414 * @throws SystemException if a system exception occurred 415 */ 416 public static com.liferay.portal.model.LayoutSoap updateLookAndFeel( 417 long groupId, boolean privateLayout, long layoutId, 418 java.lang.String themeId, java.lang.String colorSchemeId, 419 java.lang.String css, boolean wapTheme) throws RemoteException { 420 try { 421 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateLookAndFeel(groupId, 422 privateLayout, layoutId, themeId, colorSchemeId, css, 423 wapTheme); 424 425 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 426 } 427 catch (Exception e) { 428 _log.error(e, e); 429 430 throw new RemoteException(e.getMessage()); 431 } 432 } 433 434 /** 435 * Updates the name of the layout matching the group, layout ID, and 436 * privacy. 437 * 438 * @param groupId the primary key of the group 439 * @param privateLayout whether the layout is private to the group 440 * @param layoutId the primary key of the layout 441 * @param name the layout's new name 442 * @param languageId the primary key of the language. For more information 443 see {@link java.util.Locale}. 444 * @return the updated layout 445 * @throws PortalException if a matching layout could not be found, if the 446 user did not have permission to update the layout, or if the new 447 name was <code>null</code> 448 * @throws SystemException if a system exception occurred 449 */ 450 public static com.liferay.portal.model.LayoutSoap updateName(long groupId, 451 boolean privateLayout, long layoutId, java.lang.String name, 452 java.lang.String languageId) throws RemoteException { 453 try { 454 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(groupId, 455 privateLayout, layoutId, name, languageId); 456 457 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 458 } 459 catch (Exception e) { 460 _log.error(e, e); 461 462 throw new RemoteException(e.getMessage()); 463 } 464 } 465 466 /** 467 * Updates the name of the layout matching the primary key. 468 * 469 * @param plid the primary key of the layout 470 * @param name the name to be assigned 471 * @param languageId the primary key of the language. For more information 472 see {@link java.util.Locale}. 473 * @return the updated layout 474 * @throws PortalException if a layout with the primary key could not be 475 found, or if the user did not have permission to update the 476 layout, or if the name was <code>null</code> 477 * @throws SystemException if a system exception occurred 478 */ 479 public static com.liferay.portal.model.LayoutSoap updateName(long plid, 480 java.lang.String name, java.lang.String languageId) 481 throws RemoteException { 482 try { 483 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateName(plid, 484 name, languageId); 485 486 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 487 } 488 catch (Exception e) { 489 _log.error(e, e); 490 491 throw new RemoteException(e.getMessage()); 492 } 493 } 494 495 /** 496 * Updates the parent layout ID of the layout matching the group, layout ID, 497 * and privacy. 498 * 499 * @param groupId the primary key of the group 500 * @param privateLayout whether the layout is private to the group 501 * @param layoutId the primary key of the layout 502 * @param parentLayoutId the primary key to be assigned to the parent 503 layout 504 * @return the matching layout 505 * @throws PortalException if a valid parent layout ID to use could not be 506 found, if a matching layout could not be found, or if the user 507 did not have permission to update the layout 508 * @throws SystemException if a system exception occurred 509 */ 510 public static com.liferay.portal.model.LayoutSoap updateParentLayoutId( 511 long groupId, boolean privateLayout, long layoutId, long parentLayoutId) 512 throws RemoteException { 513 try { 514 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(groupId, 515 privateLayout, layoutId, parentLayoutId); 516 517 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 518 } 519 catch (Exception e) { 520 _log.error(e, e); 521 522 throw new RemoteException(e.getMessage()); 523 } 524 } 525 526 /** 527 * Updates the parent layout ID of the layout matching the primary key. If a 528 * layout matching the parent primary key is found, the layout ID of that 529 * layout is assigned, otherwise {@link 530 * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is 531 * assigned. 532 * 533 * @param plid the primary key of the layout 534 * @param parentPlid the primary key of the parent layout 535 * @return the layout matching the primary key 536 * @throws PortalException if a layout with the primary key could not be 537 found, if the user did not have permission to update the layout, 538 or if a valid parent layout ID to use could not be found 539 * @throws SystemException if a system exception occurred 540 */ 541 public static com.liferay.portal.model.LayoutSoap updateParentLayoutId( 542 long plid, long parentPlid) throws RemoteException { 543 try { 544 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updateParentLayoutId(plid, 545 parentPlid); 546 547 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 548 } 549 catch (Exception e) { 550 _log.error(e, e); 551 552 throw new RemoteException(e.getMessage()); 553 } 554 } 555 556 /** 557 * Updates the priority of the layout matching the group, layout ID, and 558 * privacy. 559 * 560 * @param groupId the primary key of the group 561 * @param privateLayout whether the layout is private to the group 562 * @param layoutId the primary key of the layout 563 * @param priority the layout's new priority 564 * @return the updated layout 565 * @throws PortalException if a matching layout could not be found or if the 566 user did not have permission to update the layout 567 * @throws SystemException if a system exception occurred 568 */ 569 public static com.liferay.portal.model.LayoutSoap updatePriority( 570 long groupId, boolean privateLayout, long layoutId, int priority) 571 throws RemoteException { 572 try { 573 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(groupId, 574 privateLayout, layoutId, priority); 575 576 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 577 } 578 catch (Exception e) { 579 _log.error(e, e); 580 581 throw new RemoteException(e.getMessage()); 582 } 583 } 584 585 /** 586 * Updates the priority of the layout matching the primary key. 587 * 588 * @param plid the primary key of the layout 589 * @param priority the layout's new priority 590 * @return the updated layout 591 * @throws PortalException if a layout with the primary key could not be 592 found 593 * @throws SystemException if a system exception occurred 594 */ 595 public static com.liferay.portal.model.LayoutSoap updatePriority( 596 long plid, int priority) throws RemoteException { 597 try { 598 com.liferay.portal.model.Layout returnValue = LayoutServiceUtil.updatePriority(plid, 599 priority); 600 601 return com.liferay.portal.model.LayoutSoap.toSoapModel(returnValue); 602 } 603 catch (Exception e) { 604 _log.error(e, e); 605 606 throw new RemoteException(e.getMessage()); 607 } 608 } 609 610 private static Log _log = LogFactoryUtil.getLog(LayoutServiceSoap.class); 611 }