001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 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 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 secureConnection whether the connection is secure 630 * @param remoteGroupId the primary key of the remote group 631 * @param remotePrivateLayout whether remote group's layout is private 632 * @param startDate the start date 633 * @param endDate the end date 634 * @param groupName the group name. Optionally {@link 635 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 636 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 637 * @param cronText the cron text. See {@link 638 com.liferay.portal.kernel.cal.RecurrenceSerializer #toCronText} 639 * @param schedulerStartDate the scheduler start date 640 * @param schedulerEndDate the scheduler end date 641 * @param description the scheduler description 642 * @throws PortalException if a group with the source group primary key was 643 not found or if the group did not have permission to publish 644 * @throws SystemException if a system exception occurred 645 */ 646 public static void schedulePublishToRemote(long sourceGroupId, 647 boolean privateLayout, 648 java.util.Map<java.lang.Long, java.lang.Boolean> layoutIdMap, 649 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 650 java.lang.String remoteAddress, int remotePort, 651 java.lang.String remotePathContext, boolean secureConnection, 652 long remoteGroupId, boolean remotePrivateLayout, 653 java.util.Date startDate, java.util.Date endDate, 654 java.lang.String groupName, java.lang.String cronText, 655 java.util.Date schedulerStartDate, java.util.Date schedulerEndDate, 656 java.lang.String description) 657 throws com.liferay.portal.kernel.exception.PortalException, 658 com.liferay.portal.kernel.exception.SystemException { 659 getService() 660 .schedulePublishToRemote(sourceGroupId, privateLayout, layoutIdMap, 661 parameterMap, remoteAddress, remotePort, remotePathContext, 662 secureConnection, remoteGroupId, remotePrivateLayout, startDate, 663 endDate, groupName, cronText, schedulerStartDate, schedulerEndDate, 664 description); 665 } 666 667 /** 668 * Sets the layouts for the group, replacing and prioritizing all layouts of 669 * the parent layout. 670 * 671 * @param groupId the primary key of the group 672 * @param privateLayout whether the layout is private to the group 673 * @param parentLayoutId the primary key of the parent layout 674 * @param layoutIds the primary keys of the layouts 675 * @param serviceContext the service context 676 * @throws PortalException if a group or layout with the primary key could 677 not be found, if the group did not have permission to manage the 678 layouts, if no layouts were specified, if the first layout was 679 not page-able, if the first layout was hidden, or if some other 680 portal exception occurred 681 * @throws SystemException if a system exception occurred 682 */ 683 public static void setLayouts(long groupId, boolean privateLayout, 684 long parentLayoutId, long[] layoutIds, 685 com.liferay.portal.service.ServiceContext serviceContext) 686 throws com.liferay.portal.kernel.exception.PortalException, 687 com.liferay.portal.kernel.exception.SystemException { 688 getService() 689 .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds, 690 serviceContext); 691 } 692 693 /** 694 * Deletes the job from the scheduler's queue. 695 * 696 * @param groupId the primary key of the group 697 * @param jobName the job name 698 * @param groupName the group name (optionally {@link 699 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 700 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 701 * @throws PortalException if the group did not permission to manage staging 702 and publish 703 * @throws SystemException if a system exception occurred 704 */ 705 public static void unschedulePublishToLive(long groupId, 706 java.lang.String jobName, java.lang.String groupName) 707 throws com.liferay.portal.kernel.exception.PortalException, 708 com.liferay.portal.kernel.exception.SystemException { 709 getService().unschedulePublishToLive(groupId, jobName, groupName); 710 } 711 712 /** 713 * Deletes the job from the scheduler's persistent queue. 714 * 715 * @param groupId the primary key of the group 716 * @param jobName the job name 717 * @param groupName the group name (optionally {@link 718 com.liferay.portal.kernel.messaging.DestinationNames#LAYOUTS_LOCAL_PUBLISHER}). 719 See {@link com.liferay.portal.kernel.messaging.DestinationNames}. 720 * @throws PortalException if a group with the primary key could not be 721 found or if the group did not have permission to publish 722 * @throws SystemException if a system exception occurred 723 */ 724 public static void unschedulePublishToRemote(long groupId, 725 java.lang.String jobName, java.lang.String groupName) 726 throws com.liferay.portal.kernel.exception.PortalException, 727 com.liferay.portal.kernel.exception.SystemException { 728 getService().unschedulePublishToRemote(groupId, jobName, groupName); 729 } 730 731 /** 732 * Updates the layout. 733 * 734 * @param groupId the primary key of the group 735 * @param privateLayout whether the layout is private to the group 736 * @param layoutId the primary key of the layout 737 * @param parentLayoutId the primary key of the layout's new parent layout 738 * @param localeNamesMap the layout's locales and localized names 739 * @param localeTitlesMap the layout's locales and localized titles 740 * @param descriptionMap the locales and localized descriptions to merge 741 (optionally <code>null</code>) 742 * @param keywordsMap the locales and localized keywords to merge 743 (optionally <code>null</code>) 744 * @param robotsMap the locales and localized robots to merge (optionally 745 <code>null</code>) 746 * @param type the layout's new type (optionally {@link 747 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}) 748 * @param hidden whether the layout is hidden 749 * @param friendlyURL the layout's new friendly URL (optionally {@link 750 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 751 or {@link 752 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}). 753 The default values can be overridden in 754 <code>portal-ext.properties</code> by specifying new values for 755 the corresponding properties defined in {@link 756 com.liferay.portal.util.PropsValues}. To see how the URL is 757 normalized when accessed see {@link 758 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 759 String)}. 760 * @param iconImage whether the icon image will be updated 761 * @param iconBytes the byte array of the layout's new icon image 762 * @param serviceContext the service context. Can set the modification date 763 and expando bridge attributes for the layout. 764 * @return the updated layout 765 * @throws PortalException if a group or layout with the primary key could 766 not be found, if the user did not have permission to update the 767 layout, if a unique friendly URL could not be generated, if a 768 valid parent layout ID to use could not be found, or if the 769 layout parameters were invalid 770 * @throws SystemException if a system exception occurred 771 */ 772 public static com.liferay.portal.model.Layout updateLayout(long groupId, 773 boolean privateLayout, long layoutId, long parentLayoutId, 774 java.util.Map<java.util.Locale, java.lang.String> localeNamesMap, 775 java.util.Map<java.util.Locale, java.lang.String> localeTitlesMap, 776 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 777 java.util.Map<java.util.Locale, java.lang.String> keywordsMap, 778 java.util.Map<java.util.Locale, java.lang.String> robotsMap, 779 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 780 java.lang.Boolean iconImage, byte[] iconBytes, 781 com.liferay.portal.service.ServiceContext serviceContext) 782 throws com.liferay.portal.kernel.exception.PortalException, 783 com.liferay.portal.kernel.exception.SystemException { 784 return getService() 785 .updateLayout(groupId, privateLayout, layoutId, 786 parentLayoutId, localeNamesMap, localeTitlesMap, descriptionMap, 787 keywordsMap, robotsMap, type, hidden, friendlyURL, iconImage, 788 iconBytes, serviceContext); 789 } 790 791 /** 792 * Updates the layout replacing its type settings. 793 * 794 * @param groupId the primary key of the group 795 * @param privateLayout whether the layout is private to the group 796 * @param layoutId the primary key of the layout 797 * @param typeSettings the settings to load the unicode properties object. 798 See {@link com.liferay.portal.kernel.util.UnicodeProperties 799 #fastLoad(String)}. 800 * @return the updated layout 801 * @throws PortalException if a matching layout could not be found or if the 802 user did not have permission to update the layout 803 * @throws SystemException if a system exception occurred 804 */ 805 public static com.liferay.portal.model.Layout updateLayout(long groupId, 806 boolean privateLayout, long layoutId, java.lang.String typeSettings) 807 throws com.liferay.portal.kernel.exception.PortalException, 808 com.liferay.portal.kernel.exception.SystemException { 809 return getService() 810 .updateLayout(groupId, privateLayout, layoutId, typeSettings); 811 } 812 813 /** 814 * Updates the look and feel of the layout. 815 * 816 * @param groupId the primary key of the group 817 * @param privateLayout whether the layout is private to the group 818 * @param layoutId the primary key of the layout 819 * @param themeId the primary key of the layout's new theme 820 * @param colorSchemeId the primary key of the layout's new color scheme 821 * @param css the layout's new CSS 822 * @param wapTheme whether the theme is for WAP browsers 823 * @return the updated layout 824 * @throws PortalException if a matching layout could not be found, or if 825 the user did not have permission to update the layout and 826 permission to apply the theme 827 * @throws SystemException if a system exception occurred 828 */ 829 public static com.liferay.portal.model.Layout updateLookAndFeel( 830 long groupId, boolean privateLayout, long layoutId, 831 java.lang.String themeId, java.lang.String colorSchemeId, 832 java.lang.String css, boolean wapTheme) 833 throws com.liferay.portal.kernel.exception.PortalException, 834 com.liferay.portal.kernel.exception.SystemException { 835 return getService() 836 .updateLookAndFeel(groupId, privateLayout, layoutId, 837 themeId, colorSchemeId, css, wapTheme); 838 } 839 840 /** 841 * Updates the name of the layout matching the group, layout ID, and 842 * privacy. 843 * 844 * @param groupId the primary key of the group 845 * @param privateLayout whether the layout is private to the group 846 * @param layoutId the primary key of the layout 847 * @param name the layout's new name 848 * @param languageId the primary key of the language. For more information 849 see {@link java.util.Locale}. 850 * @return the updated layout 851 * @throws PortalException if a matching layout could not be found, if the 852 user did not have permission to update the layout, or if the new 853 name was <code>null</code> 854 * @throws SystemException if a system exception occurred 855 */ 856 public static com.liferay.portal.model.Layout updateName(long groupId, 857 boolean privateLayout, long layoutId, java.lang.String name, 858 java.lang.String languageId) 859 throws com.liferay.portal.kernel.exception.PortalException, 860 com.liferay.portal.kernel.exception.SystemException { 861 return getService() 862 .updateName(groupId, privateLayout, layoutId, name, 863 languageId); 864 } 865 866 /** 867 * Updates the name of the layout matching the primary key. 868 * 869 * @param plid the primary key of the layout 870 * @param name the name to be assigned 871 * @param languageId the primary key of the language. For more information 872 see {@link java.util.Locale}. 873 * @return the updated layout 874 * @throws PortalException if a layout with the primary key could not be 875 found, or if the user did not have permission to update the 876 layout, or if the name was <code>null</code> 877 * @throws SystemException if a system exception occurred 878 */ 879 public static com.liferay.portal.model.Layout updateName(long plid, 880 java.lang.String name, java.lang.String languageId) 881 throws com.liferay.portal.kernel.exception.PortalException, 882 com.liferay.portal.kernel.exception.SystemException { 883 return getService().updateName(plid, name, languageId); 884 } 885 886 /** 887 * Updates the parent layout ID of the layout matching the group, layout ID, 888 * and privacy. 889 * 890 * @param groupId the primary key of the group 891 * @param privateLayout whether the layout is private to the group 892 * @param layoutId the primary key of the layout 893 * @param parentLayoutId the primary key to be assigned to the parent 894 layout 895 * @return the matching layout 896 * @throws PortalException if a valid parent layout ID to use could not be 897 found, if a matching layout could not be found, or if the user 898 did not have permission to update the layout 899 * @throws SystemException if a system exception occurred 900 */ 901 public static com.liferay.portal.model.Layout updateParentLayoutId( 902 long groupId, boolean privateLayout, long layoutId, long parentLayoutId) 903 throws com.liferay.portal.kernel.exception.PortalException, 904 com.liferay.portal.kernel.exception.SystemException { 905 return getService() 906 .updateParentLayoutId(groupId, privateLayout, layoutId, 907 parentLayoutId); 908 } 909 910 /** 911 * Updates the parent layout ID of the layout matching the primary key. If a 912 * layout matching the parent primary key is found, the layout ID of that 913 * layout is assigned, otherwise {@link 914 * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is 915 * assigned. 916 * 917 * @param plid the primary key of the layout 918 * @param parentPlid the primary key of the parent layout 919 * @return the layout matching the primary key 920 * @throws PortalException if a layout with the primary key could not be 921 found, if the user did not have permission to update the layout, 922 or if a valid parent layout ID to use could not be found 923 * @throws SystemException if a system exception occurred 924 */ 925 public static com.liferay.portal.model.Layout updateParentLayoutId( 926 long plid, long parentPlid) 927 throws com.liferay.portal.kernel.exception.PortalException, 928 com.liferay.portal.kernel.exception.SystemException { 929 return getService().updateParentLayoutId(plid, parentPlid); 930 } 931 932 /** 933 * Updates the priority of the layout matching the group, layout ID, and 934 * privacy. 935 * 936 * @param groupId the primary key of the group 937 * @param privateLayout whether the layout is private to the group 938 * @param layoutId the primary key of the layout 939 * @param priority the layout's new priority 940 * @return the updated layout 941 * @throws PortalException if a matching layout could not be found or if the 942 user did not have permission to update the layout 943 * @throws SystemException if a system exception occurred 944 */ 945 public static com.liferay.portal.model.Layout updatePriority(long groupId, 946 boolean privateLayout, long layoutId, int priority) 947 throws com.liferay.portal.kernel.exception.PortalException, 948 com.liferay.portal.kernel.exception.SystemException { 949 return getService() 950 .updatePriority(groupId, privateLayout, layoutId, priority); 951 } 952 953 /** 954 * Updates the priority of the layout matching the primary key. 955 * 956 * @param plid the primary key of the layout 957 * @param priority the layout's new priority 958 * @return the updated layout 959 * @throws PortalException if a layout with the primary key could not be 960 found 961 * @throws SystemException if a system exception occurred 962 */ 963 public static com.liferay.portal.model.Layout updatePriority(long plid, 964 int priority) 965 throws com.liferay.portal.kernel.exception.PortalException, 966 com.liferay.portal.kernel.exception.SystemException { 967 return getService().updatePriority(plid, priority); 968 } 969 970 public static LayoutService getService() { 971 if (_service == null) { 972 _service = (LayoutService)PortalBeanLocatorUtil.locate(LayoutService.class.getName()); 973 974 ReferenceRegistry.registerReference(LayoutServiceUtil.class, 975 "_service"); 976 } 977 978 return _service; 979 } 980 981 /** 982 * @deprecated 983 */ 984 public void setService(LayoutService service) { 985 } 986 987 private static LayoutService _service; 988 }