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