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; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the layout remote service. This utility wraps {@link com.liferay.portal.service.impl.LayoutServiceImpl} and is the primary access point for service operations in application layer code running on a remote server. 022 * 023 * <p> 024 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see LayoutService 029 * @see com.liferay.portal.service.base.LayoutServiceBaseImpl 030 * @see com.liferay.portal.service.impl.LayoutServiceImpl 031 * @generated 032 */ 033 public class LayoutServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Returns the Spring bean ID for this bean. 042 * 043 * @return the Spring bean ID for this bean 044 */ 045 public static java.lang.String getBeanIdentifier() { 046 return getService().getBeanIdentifier(); 047 } 048 049 /** 050 * Sets the Spring bean ID for this bean. 051 * 052 * @param beanIdentifier the Spring bean ID for this bean 053 */ 054 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 055 getService().setBeanIdentifier(beanIdentifier); 056 } 057 058 /** 059 * Adds a layout with additional parameters. 060 * 061 * <p> 062 * This method handles the creation of the layout including its resources, 063 * metadata, and internal data structures. It is not necessary to make 064 * subsequent calls to any methods to setup default groups, resources, ... 065 * etc. 066 * </p> 067 * 068 * @param groupId the primary key of the group 069 * @param privateLayout whether the layout is private to the group 070 * @param parentLayoutId the primary key of the parent layout (optionally 071 {@link 072 com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID}) 073 * @param localeNamesMap the layout's locales and localized names 074 * @param localeTitlesMap the layout's locales and localized titles 075 * @param descriptionMap the layout's locales and localized descriptions 076 * @param keywordsMap the layout's locales and localized keywords 077 * @param robotsMap the layout's locales and localized robots 078 * @param type the layout's type (optionally {@link 079 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The 080 possible types can be found in {@link 081 com.liferay.portal.model.LayoutConstants}. 082 * @param hidden whether the layout is hidden 083 * @param friendlyURL the layout's friendly URL (optionally {@link 084 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 085 or {@link 086 com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}). 087 The default values can be overridden in 088 <code>portal-ext.properties</code> by specifying new values for 089 the corresponding properties defined in {@link 090 com.liferay.portal.util.PropsValues}. To see how the URL is 091 normalized when accessed see {@link 092 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 093 String)}. 094 * @param serviceContext the service context. Must set the universally 095 unique identifier (UUID) for the layout. Can set the creation 096 date, modification date and the expando bridge attributes for the 097 layout. For layouts that belong to a layout set prototype, an 098 attribute named 'layoutUpdateable' can be used to specify whether 099 site administrators can modify this page within their site. 100 * @return the layout 101 * @throws PortalException if a group with the primary key could not be 102 found, if the group did not have permission to manage the layouts 103 involved, or if layout values were invalid 104 * @throws SystemException if a system exception occurred 105 */ 106 public static com.liferay.portal.model.Layout addLayout(long groupId, 107 boolean privateLayout, long parentLayoutId, 108 java.util.Map<java.util.Locale, java.lang.String> localeNamesMap, 109 java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap, 110 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 111 java.util.Map<java.util.Locale, java.lang.String> keywordsMap, 112 java.util.Map<java.util.Locale, java.lang.String> robotsMap, 113 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 114 com.liferay.portal.service.ServiceContext serviceContext) 115 throws com.liferay.portal.kernel.exception.PortalException, 116 com.liferay.portal.kernel.exception.SystemException { 117 return getService() 118 .addLayout(groupId, privateLayout, parentLayoutId, 119 localeNamesMap, localeTitlesMap, descriptionMap, keywordsMap, 120 robotsMap, type, hidden, friendlyURL, serviceContext); 121 } 122 123 /** 124 * Adds a layout with empty maps for descriptions, keywords, and titles , 125 * and a names map containing a mapping for the default locale as its only 126 * entry. 127 * 128 * <p> 129 * This method handles the creation of the layout including its resources, 130 * metadata, and internal data structures. It is not necessary to make 131 * subsequent calls to any methods to setup default groups, resources, ... 132 * etc. 133 * </p> 134 * 135 * @param groupId the primary key of the group 136 * @param privateLayout whether the layout is private to the group 137 * @param parentLayoutId the primary key of the parent layout (optionally 138 {@link 139 com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID}) 140 * @param name Map the layout's locales and localized names 141 * @param title Map the layout's locales and localized titles 142 * @param description Map the layout's locales and localized descriptions 143 * @param type the layout's type (optionally {@link 144 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The 145 possible types can be found in {@link 146 com.liferay.portal.model.LayoutConstants}. 147 * @param hidden whether the layout is hidden 148 * @param friendlyURL the layout's friendly URL (optionally {@link 149 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 150 or {@link 151 com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}). 152 The default values can be overridden in 153 <code>portal-ext.properties</code> by specifying new values for 154 the corresponding properties defined in {@link 155 com.liferay.portal.util.PropsValues}. To see how the URL is 156 normalized when accessed see {@link 157 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 158 String)}. 159 * @param serviceContext the service context. Must set the universally 160 unique identifier (UUID) for the layout. Can specify the creation 161 date, modification date and the expando bridge attributes for the 162 layout. For layouts that belong to a layout set prototype, an 163 attribute named 'layoutUpdateable' can be used to specify whether 164 site administrators can modify this page within their site. 165 * @return the layout 166 * @throws PortalException if a group with the primary key could not be 167 found, if the group did not have permission to manage the layouts 168 involved, or if layout values were invalid 169 * @throws SystemException if a system exception occurred 170 */ 171 public static com.liferay.portal.model.Layout addLayout(long groupId, 172 boolean privateLayout, long parentLayoutId, java.lang.String name, 173 java.lang.String title, java.lang.String description, 174 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 175 com.liferay.portal.service.ServiceContext serviceContext) 176 throws com.liferay.portal.kernel.exception.PortalException, 177 com.liferay.portal.kernel.exception.SystemException { 178 return getService() 179 .addLayout(groupId, privateLayout, parentLayoutId, name, 180 title, description, type, hidden, friendlyURL, serviceContext); 181 } 182 183 /** 184 * Deletes the layout with the primary key, also deleting the layout's child 185 * layouts, and associated resources. 186 * 187 * @param groupId the primary key of the group 188 * @param privateLayout whether the layout is private to the group 189 * @param layoutId the primary key of the layout 190 * @param serviceContext the service context 191 * @throws PortalException if the user did not have permission to delete the 192 layout, if a matching layout could not be found , or if some 193 other portal exception occurred 194 * @throws SystemException if a system exception occurred 195 */ 196 public static void deleteLayout(long groupId, boolean privateLayout, 197 long layoutId, com.liferay.portal.service.ServiceContext serviceContext) 198 throws com.liferay.portal.kernel.exception.PortalException, 199 com.liferay.portal.kernel.exception.SystemException { 200 getService() 201 .deleteLayout(groupId, privateLayout, layoutId, serviceContext); 202 } 203 204 /** 205 * Deletes the layout with the plid, also deleting the layout's child 206 * layouts, and associated resources. 207 * 208 * @param plid the primary key of the layout 209 * @param serviceContext the service context 210 * @throws PortalException if the user did not have permission to delete the 211 layout, if a layout with the primary key could not be found , or 212 if some other portal exception occurred 213 * @throws SystemException if a system exception occurred 214 */ 215 public static void deleteLayout(long plid, 216 com.liferay.portal.service.ServiceContext serviceContext) 217 throws com.liferay.portal.kernel.exception.PortalException, 218 com.liferay.portal.kernel.exception.SystemException { 219 getService().deleteLayout(plid, serviceContext); 220 } 221 222 /** 223 * Exports the layouts that match the primary keys and the criteria as a 224 * byte array. 225 * 226 * @param groupId the primary key of the group 227 * @param privateLayout whether the layout is private to the group 228 * @param layoutIds the primary keys of the layouts to be exported 229 * @param parameterMap the mapping of parameters indicating which 230 information to export. For information on the keys used in the 231 map see {@link 232 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 233 * @param startDate the export's start date 234 * @param endDate the export's end date 235 * @return the layouts as a byte array 236 * @throws PortalException if a group or any layout with the primary key 237 could not be found, if the group did not have permission to 238 manage the layouts, or if some other portal exception occurred 239 * @throws SystemException if a system exception occurred 240 */ 241 public static byte[] exportLayouts(long groupId, boolean privateLayout, 242 long[] layoutIds, 243 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 244 java.util.Date startDate, java.util.Date endDate) 245 throws com.liferay.portal.kernel.exception.PortalException, 246 com.liferay.portal.kernel.exception.SystemException { 247 return getService() 248 .exportLayouts(groupId, privateLayout, layoutIds, 249 parameterMap, startDate, endDate); 250 } 251 252 /** 253 * Exports all layouts that match the criteria as a byte array. 254 * 255 * @param groupId the primary key of the group 256 * @param privateLayout whether the layout is private to the group 257 * @param parameterMap the mapping of parameters indicating which 258 information to export. For information on the keys used in the 259 map see {@link 260 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 261 * @param startDate the export's start date 262 * @param endDate the export's end date 263 * @return the layout as a byte array 264 * @throws PortalException if a group with the primary key could not be 265 found, if the group did not have permission to manage the 266 layouts, or if some other portal exception occurred 267 * @throws SystemException if a system exception occurred 268 */ 269 public static byte[] exportLayouts(long groupId, boolean privateLayout, 270 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 271 java.util.Date startDate, java.util.Date endDate) 272 throws com.liferay.portal.kernel.exception.PortalException, 273 com.liferay.portal.kernel.exception.SystemException { 274 return getService() 275 .exportLayouts(groupId, privateLayout, parameterMap, 276 startDate, endDate); 277 } 278 279 /** 280 * Exports all layouts that match the primary keys and criteria as a file. 281 * 282 * @param groupId the primary key of the group 283 * @param privateLayout whether the layout is private to the group 284 * @param layoutIds the primary keys of the layouts to be exported 285 (optionally <code>null</code>) 286 * @param parameterMap the mapping of parameters indicating which 287 information to export. For information on the keys used in the 288 map see {@link 289 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 290 * @param startDate the export's start date 291 * @param endDate the export's end date 292 * @return the layouts as a File 293 * @throws PortalException if a group or any layout with the primary key 294 could not be found, it the group did not have permission to 295 manage the layouts, or if some other portal exception occurred 296 * @throws SystemException if a system exception occurred 297 */ 298 public static java.io.File exportLayoutsAsFile(long groupId, 299 boolean privateLayout, long[] layoutIds, 300 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 301 java.util.Date startDate, java.util.Date endDate) 302 throws com.liferay.portal.kernel.exception.PortalException, 303 com.liferay.portal.kernel.exception.SystemException { 304 return getService() 305 .exportLayoutsAsFile(groupId, privateLayout, layoutIds, 306 parameterMap, startDate, endDate); 307 } 308 309 /** 310 * Exports the portlet information (categories, permissions, ... etc.) as a 311 * byte array. 312 * 313 * @param plid the primary key of the layout 314 * @param groupId the primary key of the group 315 * @param portletId the primary key of the portlet 316 * @param parameterMap the mapping of parameters indicating which 317 information to export. For information on the keys used in the 318 map see {@link 319 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 320 * @param startDate the export's start date 321 * @param endDate the export's end date 322 * @return the portlet information as a byte array 323 * @throws PortalException if a layout, group, or portlet with the primary 324 key could not be found, if the group did not have permission to 325 manage the layouts involved, or if some other portal exception 326 occurred 327 * @throws SystemException if a system exception occurred 328 */ 329 public static byte[] exportPortletInfo(long plid, long groupId, 330 java.lang.String portletId, 331 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 332 java.util.Date startDate, java.util.Date endDate) 333 throws com.liferay.portal.kernel.exception.PortalException, 334 com.liferay.portal.kernel.exception.SystemException { 335 return getService() 336 .exportPortletInfo(plid, groupId, portletId, parameterMap, 337 startDate, endDate); 338 } 339 340 /** 341 * Exports the portlet information (categories, permissions, ... etc.) as a 342 * file. 343 * 344 * @param plid the primary key of the layout 345 * @param groupId the primary key of the group 346 * @param portletId the primary key of the portlet 347 * @param parameterMap the mapping of parameters indicating which 348 information to export. For information on the keys used in the 349 map see {@link 350 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 351 * @param startDate the export's start date 352 * @param endDate the export's end date 353 * @return the portlet information as a file 354 * @throws PortalException if a layout, group, or portlet with the primary 355 key could not be found, it the group did not have permission to 356 manage the layouts involved, or if some other portal exception 357 occurred 358 * @throws SystemException if a system exception occurred 359 */ 360 public static java.io.File exportPortletInfoAsFile(long plid, long groupId, 361 java.lang.String portletId, 362 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 363 java.util.Date startDate, java.util.Date endDate) 364 throws com.liferay.portal.kernel.exception.PortalException, 365 com.liferay.portal.kernel.exception.SystemException { 366 return getService() 367 .exportPortletInfoAsFile(plid, groupId, portletId, 368 parameterMap, startDate, endDate); 369 } 370 371 /** 372 * Returns the primary key of the default layout for the group. 373 * 374 * @param groupId the primary key of the group 375 * @param scopeGroupId the primary key of the scope group. See {@link 376 com.liferay.portal.service.ServiceContext#getScopeGroupId()}. 377 * @param privateLayout whether the layout is private to the group 378 * @param portletId the primary key of the portlet 379 * @return Returns the primary key of the default layout group; {@link 380 com.liferay.portal.model.LayoutConstants#DEFAULT_PLID} otherwise 381 * @throws PortalException if a group, layout, or portlet with the primary 382 key could not be found 383 * @throws SystemException if a system exception occurred 384 */ 385 public static long getDefaultPlid(long groupId, long scopeGroupId, 386 boolean privateLayout, java.lang.String portletId) 387 throws com.liferay.portal.kernel.exception.PortalException, 388 com.liferay.portal.kernel.exception.SystemException { 389 return getService() 390 .getDefaultPlid(groupId, scopeGroupId, privateLayout, 391 portletId); 392 } 393 394 /** 395 * Returns the name of the layout. 396 * 397 * @param groupId the primary key of the group 398 * @param privateLayout whether the layout is private to the group 399 * @param layoutId the primary key of the layout 400 * @param languageId the primary key of the language. For more information 401 See {@link java.util.Locale}. 402 * @return the layout's name 403 * @throws PortalException if a matching layout could not be found 404 * @throws SystemException if a system exception occurred 405 */ 406 public static java.lang.String getLayoutName(long groupId, 407 boolean privateLayout, long layoutId, java.lang.String languageId) 408 throws com.liferay.portal.kernel.exception.PortalException, 409 com.liferay.portal.kernel.exception.SystemException { 410 return getService() 411 .getLayoutName(groupId, privateLayout, layoutId, languageId); 412 } 413 414 /** 415 * Returns the layout references for all the layouts that belong to the 416 * company and belong to the portlet that matches the preferences. 417 * 418 * @param companyId the primary key of the company 419 * @param portletId the primary key of the portlet 420 * @param preferencesKey the portlet's preference key 421 * @param preferencesValue the portlet's preference value 422 * @return the layout references of the matching layouts 423 * @throws SystemException if a system exception occurred 424 */ 425 public static com.liferay.portal.model.LayoutReference[] getLayoutReferences( 426 long companyId, java.lang.String portletId, 427 java.lang.String preferencesKey, java.lang.String preferencesValue) 428 throws com.liferay.portal.kernel.exception.SystemException { 429 return getService() 430 .getLayoutReferences(companyId, portletId, preferencesKey, 431 preferencesValue); 432 } 433 434 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 435 long groupId, boolean privateLayout) 436 throws com.liferay.portal.kernel.exception.PortalException, 437 com.liferay.portal.kernel.exception.SystemException { 438 return getService().getLayouts(groupId, privateLayout); 439 } 440 441 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 442 long groupId, boolean privateLayout, long parentLayoutId) 443 throws com.liferay.portal.kernel.exception.PortalException, 444 com.liferay.portal.kernel.exception.SystemException { 445 return getService().getLayouts(groupId, privateLayout, parentLayoutId); 446 } 447 448 /** 449 * Imports the layouts from the byte array. 450 * 451 * @param groupId the primary key of the group 452 * @param privateLayout whether the layout is private to the group 453 * @param parameterMap the mapping of parameters indicating which 454 information will be imported. For information on the keys used in 455 the map see {@link 456 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 457 * @param bytes the byte array with the data 458 * @throws PortalException if a group with the primary key could not be 459 found, if the group did not have permission to manage the 460 layouts, or if some other portal exception occurred 461 * @throws SystemException if a system exception occurred 462 * @see com.liferay.portal.lar.LayoutImporter 463 */ 464 public static void importLayouts(long groupId, boolean privateLayout, 465 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 466 byte[] bytes) 467 throws com.liferay.portal.kernel.exception.PortalException, 468 com.liferay.portal.kernel.exception.SystemException { 469 getService().importLayouts(groupId, privateLayout, parameterMap, bytes); 470 } 471 472 /** 473 * Imports the layouts from the file. 474 * 475 * @param groupId the primary key of the group 476 * @param privateLayout whether the layout is private to the group 477 * @param parameterMap the mapping of parameters indicating which 478 information will be imported. For information on the keys used in 479 the map see {@link 480 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 481 * @param file the LAR file with the data 482 * @throws PortalException if a group with the primary key could not be 483 found, if the group did not have permission to manage the layouts 484 and publish, or if some other portal exception occurred 485 * @throws SystemException if a system exception occurred 486 * @see com.liferay.portal.lar.LayoutImporter 487 */ 488 public static void importLayouts(long groupId, boolean privateLayout, 489 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 490 java.io.File file) 491 throws com.liferay.portal.kernel.exception.PortalException, 492 com.liferay.portal.kernel.exception.SystemException { 493 getService().importLayouts(groupId, privateLayout, parameterMap, file); 494 } 495 496 /** 497 * Imports the layouts from the input stream. 498 * 499 * @param groupId the primary key of the group 500 * @param privateLayout whether the layout is private to the group 501 * @param parameterMap the mapping of parameters indicating which 502 information will be imported. For information on the keys used in 503 the map see {@link 504 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 505 * @param is the input stream 506 * @throws PortalException if a group with the primary key could not be 507 found, if the group did not have permission to manage the 508 layouts, or if some other portal exception occurred 509 * @throws SystemException if a system exception occurred 510 * @see com.liferay.portal.lar.LayoutImporter 511 */ 512 public static void importLayouts(long groupId, boolean privateLayout, 513 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 514 java.io.InputStream is) 515 throws com.liferay.portal.kernel.exception.PortalException, 516 com.liferay.portal.kernel.exception.SystemException { 517 getService().importLayouts(groupId, privateLayout, parameterMap, is); 518 } 519 520 /** 521 * Imports the portlet information (categories, permissions, ... etc.) from 522 * the file. 523 * 524 * @param plid the primary key of the layout 525 * @param groupId the primary key of the group 526 * @param portletId the primary key of the portlet 527 * @param parameterMap the mapping of parameters indicating which 528 information will be imported. For information on the keys used in 529 the map see {@link 530 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 531 * @param file the LAR file with the data 532 * @throws PortalException if a group, layout, or portlet with the primary 533 key could not be found, or if the group did not have permission 534 to manage the layouts 535 * @throws SystemException if a system exception occurred 536 */ 537 public static void importPortletInfo(long plid, long groupId, 538 java.lang.String portletId, 539 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 540 java.io.File file) 541 throws com.liferay.portal.kernel.exception.PortalException, 542 com.liferay.portal.kernel.exception.SystemException { 543 getService() 544 .importPortletInfo(plid, groupId, portletId, parameterMap, file); 545 } 546 547 /** 548 * Imports the portlet information (categories, permissions, ... etc.) from 549 * the input stream. 550 * 551 * @param plid the primary key of the layout 552 * @param groupId the primary key of the group 553 * @param portletId the primary key of the portlet 554 * @param parameterMap the mapping of parameters indicating which 555 information will be imported. For information on the keys used in 556 the map see {@link 557 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 558 * @param is the input stream 559 * @throws PortalException if a group, portlet, or layout with the primary 560 key could not be found or if the group did not have permission to 561 manage the layouts 562 * @throws SystemException if a system exception occurred 563 */ 564 public static void importPortletInfo(long plid, long groupId, 565 java.lang.String portletId, 566 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 567 java.io.InputStream is) 568 throws com.liferay.portal.kernel.exception.PortalException, 569 com.liferay.portal.kernel.exception.SystemException { 570 getService() 571 .importPortletInfo(plid, groupId, portletId, parameterMap, is); 572 } 573 574 /** 575 * Schedules a range of layouts to be published. 576 * 577 * @param sourceGroupId the primary key of the source group 578 * @param targetGroupId the primary key of the target group 579 * @param privateLayout whether the layout is private to the group 580 * @param layoutIdMap the layouts considered for publishing, specified by 581 the layout IDs and booleans indicating whether they have children 582 * @param parameterMap the mapping of parameters indicating which 583 information will be used. See {@link 584 com.liferay.portal.kernel.lar.PortletDataHandlerKeys} 585 * @param scope the scope of the pages. It can be <code>all-pages</code> or 586 <code>selected-pages</code>. 587 * @param startDate the start date 588 * @param endDate the end date 589 * @param groupName the group name (optionally {@link 590 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 591 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 592 * @param cronText the cron text. See {@link 593 com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText} 594 * @param schedulerStartDate the scheduler start date 595 * @param schedulerEndDate the scheduler end date 596 * @param description the scheduler description 597 * @throws PortalException if the group did not have permission to manage 598 and publish 599 * @throws SystemException if a system exception occurred 600 */ 601 public static void schedulePublishToLive(long sourceGroupId, 602 long targetGroupId, boolean privateLayout, 603 java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap, 604 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 605 java.lang.String scope, java.util.Date startDate, 606 java.util.Date endDate, java.lang.String groupName, 607 java.lang.String cronText, java.util.Date schedulerStartDate, 608 java.util.Date schedulerEndDate, java.lang.String description) 609 throws com.liferay.portal.kernel.exception.PortalException, 610 com.liferay.portal.kernel.exception.SystemException { 611 getService() 612 .schedulePublishToLive(sourceGroupId, targetGroupId, privateLayout, 613 layoutIdMap, parameterMap, scope, startDate, endDate, groupName, 614 cronText, schedulerStartDate, schedulerEndDate, description); 615 } 616 617 /** 618 * Schedules a range of layouts to be stored. 619 * 620 * @param sourceGroupId the primary key of the source group 621 * @param privateLayout whether the layout is private to the group 622 * @param layoutIdMap the layouts considered for publishing, specified by 623 the layout IDs and booleans indicating whether they have children 624 * @param parameterMap the mapping of parameters indicating which 625 information will be used. See {@link 626 com.liferay.portal.kernel.lar.PortletDataHandlerKeys} 627 * @param remoteAddress the remote address 628 * @param remotePort the remote port 629 * @param remotePathContext the remote path context 630 * @param secureConnection whether the connection is secure 631 * @param remoteGroupId the primary key of the remote group 632 * @param remotePrivateLayout whether remote group's layout is private 633 * @param startDate the start date 634 * @param endDate the end date 635 * @param groupName the group name. Optionally {@link 636 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 637 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 638 * @param cronText the cron text. See {@link 639 com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText} 640 * @param schedulerStartDate the scheduler start date 641 * @param schedulerEndDate the scheduler end date 642 * @param description the scheduler description 643 * @throws PortalException if a group with the source group primary key was 644 not found or if the group did not have permission to publish 645 * @throws SystemException if a system exception occurred 646 */ 647 public static void schedulePublishToRemote(long sourceGroupId, 648 boolean privateLayout, 649 java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap, 650 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 651 java.lang.String remoteAddress, int remotePort, 652 java.lang.String remotePathContext, boolean secureConnection, 653 long remoteGroupId, boolean remotePrivateLayout, 654 java.util.Date startDate, java.util.Date endDate, 655 java.lang.String groupName, java.lang.String cronText, 656 java.util.Date schedulerStartDate, java.util.Date schedulerEndDate, 657 java.lang.String description) 658 throws com.liferay.portal.kernel.exception.PortalException, 659 com.liferay.portal.kernel.exception.SystemException { 660 getService() 661 .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap, 662 parameterMap, remoteAddress, remotePort, remotePathContext, 663 secureConnection, remoteGroupId, remotePrivateLayout, startDate, 664 endDate, groupName, cronText, schedulerStartDate, schedulerEndDate, 665 description); 666 } 667 668 /** 669 * Sets the layouts for the group, replacing and prioritizing all layouts of 670 * the parent layout. 671 * 672 * @param groupId the primary key of the group 673 * @param privateLayout whether the layout is private to the group 674 * @param parentLayoutId the primary key of the parent layout 675 * @param layoutIds the primary keys of the layouts 676 * @param serviceContext the service context 677 * @throws PortalException if a group or layout with the primary key could 678 not be found, if the group did not have permission to manage the 679 layouts, if no layouts were specified, if the first layout was 680 not page-able, if the first layout was hidden, or if some other 681 portal exception occurred 682 * @throws SystemException if a system exception occurred 683 */ 684 public static void setLayouts(long groupId, boolean privateLayout, 685 long parentLayoutId, long[] layoutIds, 686 com.liferay.portal.service.ServiceContext serviceContext) 687 throws com.liferay.portal.kernel.exception.PortalException, 688 com.liferay.portal.kernel.exception.SystemException { 689 getService() 690 .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds, 691 serviceContext); 692 } 693 694 /** 695 * Deletes the job from the scheduler's queue. 696 * 697 * @param groupId the primary key of the group 698 * @param jobName the job name 699 * @param groupName the group name (optionally {@link 700 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 701 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 702 * @throws PortalException if the group did not permission to manage staging 703 and publish 704 * @throws SystemException if a system exception occurred 705 */ 706 public static void unschedulePublishToLive(long groupId, 707 java.lang.String jobName, java.lang.String groupName) 708 throws com.liferay.portal.kernel.exception.PortalException, 709 com.liferay.portal.kernel.exception.SystemException { 710 getService().unschedulePublishToLive(groupId, jobName, groupName); 711 } 712 713 /** 714 * Deletes the job from the scheduler's persistent queue. 715 * 716 * @param groupId the primary key of the group 717 * @param jobName the job name 718 * @param groupName the group name (optionally {@link 719 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 720 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 721 * @throws PortalException if a group with the primary key could not be 722 found or if the group did not have permission to publish 723 * @throws SystemException if a system exception occurred 724 */ 725 public static void unschedulePublishToRemote(long groupId, 726 java.lang.String jobName, java.lang.String groupName) 727 throws com.liferay.portal.kernel.exception.PortalException, 728 com.liferay.portal.kernel.exception.SystemException { 729 getService().unschedulePublishToRemote(groupId, jobName, groupName); 730 } 731 732 /** 733 * Updates the layout. 734 * 735 * @param groupId the primary key of the group 736 * @param privateLayout whether the layout is private to the group 737 * @param layoutId the primary key of the layout 738 * @param parentLayoutId the primary key of the layout's new parent layout 739 * @param localeNamesMap the layout's locales and localized names 740 * @param localeTitlesMap the layout's locales and localized titles 741 * @param descriptionMap the locales and localized descriptions to merge 742 (optionally <code>null</code>) 743 * @param keywordsMap the locales and localized keywords to merge 744 (optionally <code>null</code>) 745 * @param robotsMap the locales and localized robots to merge (optionally 746 <code>null</code>) 747 * @param type the layout's new type (optionally {@link 748 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}) 749 * @param hidden whether the layout is hidden 750 * @param friendlyURL the layout's new friendly URL (optionally {@link 751 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 752 or {@link 753 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}). 754 The default values can be overridden in 755 <code>portal-ext.properties</code> by specifying new values for 756 the corresponding properties defined in {@link 757 com.liferay.portal.util.PropsValues}. To see how the URL is 758 normalized when accessed see {@link 759 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 760 String)}. 761 * @param iconImage whether the icon image will be updated 762 * @param iconBytes the byte array of the layout's new icon image 763 * @param serviceContext the service context. Can set the modification date 764 and expando bridge attributes for the layout. 765 * @return the updated layout 766 * @throws PortalException if a group or layout with the primary key could 767 not be found, if the user did not have permission to update the 768 layout, if a unique friendly URL could not be generated, if a 769 valid parent layout ID to use could not be found, or if the 770 layout parameters were invalid 771 * @throws SystemException if a system exception occurred 772 */ 773 public static com.liferay.portal.model.Layout updateLayout(long groupId, 774 boolean privateLayout, long layoutId, long parentLayoutId, 775 java.util.Map<java.util.Locale, java.lang.String> localeNamesMap, 776 java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap, 777 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 778 java.util.Map<java.util.Locale, java.lang.String> keywordsMap, 779 java.util.Map<java.util.Locale, java.lang.String> robotsMap, 780 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 781 java.lang.Boolean iconImage, byte[] iconBytes, 782 com.liferay.portal.service.ServiceContext serviceContext) 783 throws com.liferay.portal.kernel.exception.PortalException, 784 com.liferay.portal.kernel.exception.SystemException { 785 return getService() 786 .updateLayout(groupId, privateLayout, layoutId, 787 parentLayoutId, localeNamesMap, localeTitlesMap, descriptionMap, 788 keywordsMap, robotsMap, type, hidden, friendlyURL, iconImage, 789 iconBytes, serviceContext); 790 } 791 792 /** 793 * Updates the layout replacing its type settings. 794 * 795 * @param groupId the primary key of the group 796 * @param privateLayout whether the layout is private to the group 797 * @param layoutId the primary key of the layout 798 * @param typeSettings the settings to load the unicode properties object. 799 See {@link com.liferay.portal.kernel.util.UnicodeProperties 800 #fastLoad(String)}. 801 * @return the updated layout 802 * @throws PortalException if a matching layout could not be found or if the 803 user did not have permission to update the layout 804 * @throws SystemException if a system exception occurred 805 */ 806 public static com.liferay.portal.model.Layout updateLayout(long groupId, 807 boolean privateLayout, long layoutId, java.lang.String typeSettings) 808 throws com.liferay.portal.kernel.exception.PortalException, 809 com.liferay.portal.kernel.exception.SystemException { 810 return getService() 811 .updateLayout(groupId, privateLayout, layoutId, typeSettings); 812 } 813 814 /** 815 * Updates the look and feel of the layout. 816 * 817 * @param groupId the primary key of the group 818 * @param privateLayout whether the layout is private to the group 819 * @param layoutId the primary key of the layout 820 * @param themeId the primary key of the layout's new theme 821 * @param colorSchemeId the primary key of the layout's new color scheme 822 * @param css the layout's new CSS 823 * @param wapTheme whether the theme is for WAP browsers 824 * @return the updated layout 825 * @throws PortalException if a matching layout could not be found, or if 826 the user did not have permission to update the layout and 827 permission to apply the theme 828 * @throws SystemException if a system exception occurred 829 */ 830 public static com.liferay.portal.model.Layout updateLookAndFeel( 831 long groupId, boolean privateLayout, long layoutId, 832 java.lang.String themeId, java.lang.String colorSchemeId, 833 java.lang.String css, boolean wapTheme) 834 throws com.liferay.portal.kernel.exception.PortalException, 835 com.liferay.portal.kernel.exception.SystemException { 836 return getService() 837 .updateLookAndFeel(groupId, privateLayout, layoutId, 838 themeId, colorSchemeId, css, wapTheme); 839 } 840 841 /** 842 * Updates the name of the layout matching the group, layout ID, and 843 * privacy. 844 * 845 * @param groupId the primary key of the group 846 * @param privateLayout whether the layout is private to the group 847 * @param layoutId the primary key of the layout 848 * @param name the layout's new name 849 * @param languageId the primary key of the language. For more information 850 see {@link java.util.Locale}. 851 * @return the updated layout 852 * @throws PortalException if a matching layout could not be found, if the 853 user did not have permission to update the layout, or if the new 854 name was <code>null</code> 855 * @throws SystemException if a system exception occurred 856 */ 857 public static com.liferay.portal.model.Layout updateName(long groupId, 858 boolean privateLayout, long layoutId, java.lang.String name, 859 java.lang.String languageId) 860 throws com.liferay.portal.kernel.exception.PortalException, 861 com.liferay.portal.kernel.exception.SystemException { 862 return getService() 863 .updateName(groupId, privateLayout, layoutId, name, 864 languageId); 865 } 866 867 /** 868 * Updates the name of the layout matching the primary key. 869 * 870 * @param plid the primary key of the layout 871 * @param name the name to be assigned 872 * @param languageId the primary key of the language. For more information 873 see {@link java.util.Locale}. 874 * @return the updated layout 875 * @throws PortalException if a layout with the primary key could not be 876 found, or if the user did not have permission to update the 877 layout, or if the name was <code>null</code> 878 * @throws SystemException if a system exception occurred 879 */ 880 public static com.liferay.portal.model.Layout updateName(long plid, 881 java.lang.String name, java.lang.String languageId) 882 throws com.liferay.portal.kernel.exception.PortalException, 883 com.liferay.portal.kernel.exception.SystemException { 884 return getService().updateName(plid, name, languageId); 885 } 886 887 /** 888 * Updates the parent layout ID of the layout matching the group, layout ID, 889 * and privacy. 890 * 891 * @param groupId the primary key of the group 892 * @param privateLayout whether the layout is private to the group 893 * @param layoutId the primary key of the layout 894 * @param parentLayoutId the primary key to be assigned to the parent 895 layout 896 * @return the matching layout 897 * @throws PortalException if a valid parent layout ID to use could not be 898 found, if a matching layout could not be found, or if the user 899 did not have permission to update the layout 900 * @throws SystemException if a system exception occurred 901 */ 902 public static com.liferay.portal.model.Layout updateParentLayoutId( 903 long groupId, boolean privateLayout, long layoutId, long parentLayoutId) 904 throws com.liferay.portal.kernel.exception.PortalException, 905 com.liferay.portal.kernel.exception.SystemException { 906 return getService() 907 .updateParentLayoutId(groupId, privateLayout, layoutId, 908 parentLayoutId); 909 } 910 911 /** 912 * Updates the parent layout ID of the layout matching the primary key. If a 913 * layout matching the parent primary key is found, the layout ID of that 914 * layout is assigned, otherwise {@link 915 * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is 916 * assigned. 917 * 918 * @param plid the primary key of the layout 919 * @param parentPlid the primary key of the parent layout 920 * @return the layout matching the primary key 921 * @throws PortalException if a layout with the primary key could not be 922 found, if the user did not have permission to update the layout, 923 or if a valid parent layout ID to use could not be found 924 * @throws SystemException if a system exception occurred 925 */ 926 public static com.liferay.portal.model.Layout updateParentLayoutId( 927 long plid, long parentPlid) 928 throws com.liferay.portal.kernel.exception.PortalException, 929 com.liferay.portal.kernel.exception.SystemException { 930 return getService().updateParentLayoutId(plid, parentPlid); 931 } 932 933 /** 934 * Updates the priority of the layout matching the group, layout ID, and 935 * privacy. 936 * 937 * @param groupId the primary key of the group 938 * @param privateLayout whether the layout is private to the group 939 * @param layoutId the primary key of the layout 940 * @param priority the layout's new priority 941 * @return the updated layout 942 * @throws PortalException if a matching layout could not be found or if the 943 user did not have permission to update the layout 944 * @throws SystemException if a system exception occurred 945 */ 946 public static com.liferay.portal.model.Layout updatePriority(long groupId, 947 boolean privateLayout, long layoutId, int priority) 948 throws com.liferay.portal.kernel.exception.PortalException, 949 com.liferay.portal.kernel.exception.SystemException { 950 return getService() 951 .updatePriority(groupId, privateLayout, layoutId, priority); 952 } 953 954 /** 955 * Updates the priority of the layout matching the primary key. 956 * 957 * @param plid the primary key of the layout 958 * @param priority the layout's new priority 959 * @return the updated layout 960 * @throws PortalException if a layout with the primary key could not be 961 found 962 * @throws SystemException if a system exception occurred 963 */ 964 public static com.liferay.portal.model.Layout updatePriority(long plid, 965 int priority) 966 throws com.liferay.portal.kernel.exception.PortalException, 967 com.liferay.portal.kernel.exception.SystemException { 968 return getService().updatePriority(plid, priority); 969 } 970 971 public static LayoutService getService() { 972 if (_service == null) { 973 _service = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName()); 974 975 ReferenceRegistry.registerReference(LayoutServiceUtil.class, 976 "_service"); 977 } 978 979 return _service; 980 } 981 982 /** 983 * @deprecated 984 */ 985 public void setService(LayoutService service) { 986 } 987 988 private static LayoutService _service; 989 }