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