001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the layout local service. This utility wraps {@link com.liferay.portal.service.impl.LayoutLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 022 * 023 * <p> 024 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see LayoutLocalService 029 * @see com.liferay.portal.service.base.LayoutLocalServiceBaseImpl 030 * @see com.liferay.portal.service.impl.LayoutLocalServiceImpl 031 * @generated 032 */ 033 public class LayoutLocalServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Adds the layout to the database. Also notifies the appropriate model listeners. 042 * 043 * @param layout the layout 044 * @return the layout that was added 045 * @throws SystemException if a system exception occurred 046 */ 047 public static com.liferay.portal.model.Layout addLayout( 048 com.liferay.portal.model.Layout layout) 049 throws com.liferay.portal.kernel.exception.SystemException { 050 return getService().addLayout(layout); 051 } 052 053 /** 054 * Creates a new layout with the primary key. Does not add the layout to the database. 055 * 056 * @param plid the primary key for the new layout 057 * @return the new layout 058 */ 059 public static com.liferay.portal.model.Layout createLayout(long plid) { 060 return getService().createLayout(plid); 061 } 062 063 /** 064 * Deletes the layout with the primary key from the database. Also notifies the appropriate model listeners. 065 * 066 * @param plid the primary key of the layout 067 * @return the layout that was removed 068 * @throws PortalException if a layout with the primary key could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public static com.liferay.portal.model.Layout deleteLayout(long plid) 072 throws com.liferay.portal.kernel.exception.PortalException, 073 com.liferay.portal.kernel.exception.SystemException { 074 return getService().deleteLayout(plid); 075 } 076 077 /** 078 * Deletes the layout from the database. Also notifies the appropriate model listeners. 079 * 080 * @param layout the layout 081 * @return the layout that was removed 082 * @throws SystemException if a system exception occurred 083 */ 084 public static com.liferay.portal.model.Layout deleteLayout( 085 com.liferay.portal.model.Layout layout) 086 throws com.liferay.portal.kernel.exception.SystemException { 087 return getService().deleteLayout(layout); 088 } 089 090 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 091 return getService().dynamicQuery(); 092 } 093 094 /** 095 * Performs a dynamic query on the database and returns the matching rows. 096 * 097 * @param dynamicQuery the dynamic query 098 * @return the matching rows 099 * @throws SystemException if a system exception occurred 100 */ 101 @SuppressWarnings("rawtypes") 102 public static java.util.List dynamicQuery( 103 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 104 throws com.liferay.portal.kernel.exception.SystemException { 105 return getService().dynamicQuery(dynamicQuery); 106 } 107 108 /** 109 * Performs a dynamic query on the database and returns a range of the matching rows. 110 * 111 * <p> 112 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 113 * </p> 114 * 115 * @param dynamicQuery the dynamic query 116 * @param start the lower bound of the range of model instances 117 * @param end the upper bound of the range of model instances (not inclusive) 118 * @return the range of matching rows 119 * @throws SystemException if a system exception occurred 120 */ 121 @SuppressWarnings("rawtypes") 122 public static java.util.List dynamicQuery( 123 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 124 int end) throws com.liferay.portal.kernel.exception.SystemException { 125 return getService().dynamicQuery(dynamicQuery, start, end); 126 } 127 128 /** 129 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 130 * 131 * <p> 132 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 133 * </p> 134 * 135 * @param dynamicQuery the dynamic query 136 * @param start the lower bound of the range of model instances 137 * @param end the upper bound of the range of model instances (not inclusive) 138 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 139 * @return the ordered range of matching rows 140 * @throws SystemException if a system exception occurred 141 */ 142 @SuppressWarnings("rawtypes") 143 public static java.util.List dynamicQuery( 144 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 145 int end, 146 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 147 throws com.liferay.portal.kernel.exception.SystemException { 148 return getService() 149 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 150 } 151 152 /** 153 * Returns the number of rows that match the dynamic query. 154 * 155 * @param dynamicQuery the dynamic query 156 * @return the number of rows that match the dynamic query 157 * @throws SystemException if a system exception occurred 158 */ 159 public static long dynamicQueryCount( 160 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getService().dynamicQueryCount(dynamicQuery); 163 } 164 165 public static com.liferay.portal.model.Layout fetchLayout(long plid) 166 throws com.liferay.portal.kernel.exception.SystemException { 167 return getService().fetchLayout(plid); 168 } 169 170 /** 171 * Returns the layout with the primary key. 172 * 173 * @param plid the primary key of the layout 174 * @return the layout 175 * @throws PortalException if a layout with the primary key could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public static com.liferay.portal.model.Layout getLayout(long plid) 179 throws com.liferay.portal.kernel.exception.PortalException, 180 com.liferay.portal.kernel.exception.SystemException { 181 return getService().getLayout(plid); 182 } 183 184 public static com.liferay.portal.model.PersistedModel getPersistedModel( 185 java.io.Serializable primaryKeyObj) 186 throws com.liferay.portal.kernel.exception.PortalException, 187 com.liferay.portal.kernel.exception.SystemException { 188 return getService().getPersistedModel(primaryKeyObj); 189 } 190 191 /** 192 * @param uuid the UUID of layout 193 * @param groupId the group id of the layout 194 * @param privateLayout whether the layout is private to the group 195 * @return the layout 196 * @throws PortalException if a layout with the UUID in the group and privateLayout could not be found 197 * @throws SystemException if a system exception occurred 198 */ 199 public static com.liferay.portal.model.Layout getLayoutByUuidAndGroupId( 200 java.lang.String uuid, long groupId, boolean privateLayout) 201 throws com.liferay.portal.kernel.exception.PortalException, 202 com.liferay.portal.kernel.exception.SystemException { 203 return getService() 204 .getLayoutByUuidAndGroupId(uuid, groupId, privateLayout); 205 } 206 207 /** 208 * Returns a range of all the layouts. 209 * 210 * <p> 211 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.LayoutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 212 * </p> 213 * 214 * @param start the lower bound of the range of layouts 215 * @param end the upper bound of the range of layouts (not inclusive) 216 * @return the range of layouts 217 * @throws SystemException if a system exception occurred 218 */ 219 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 220 int start, int end) 221 throws com.liferay.portal.kernel.exception.SystemException { 222 return getService().getLayouts(start, end); 223 } 224 225 /** 226 * Returns the number of layouts. 227 * 228 * @return the number of layouts 229 * @throws SystemException if a system exception occurred 230 */ 231 public static int getLayoutsCount() 232 throws com.liferay.portal.kernel.exception.SystemException { 233 return getService().getLayoutsCount(); 234 } 235 236 /** 237 * Updates the layout in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 238 * 239 * @param layout the layout 240 * @return the layout that was updated 241 * @throws SystemException if a system exception occurred 242 */ 243 public static com.liferay.portal.model.Layout updateLayout( 244 com.liferay.portal.model.Layout layout) 245 throws com.liferay.portal.kernel.exception.SystemException { 246 return getService().updateLayout(layout); 247 } 248 249 /** 250 * Returns the Spring bean ID for this bean. 251 * 252 * @return the Spring bean ID for this bean 253 */ 254 public static java.lang.String getBeanIdentifier() { 255 return getService().getBeanIdentifier(); 256 } 257 258 /** 259 * Sets the Spring bean ID for this bean. 260 * 261 * @param beanIdentifier the Spring bean ID for this bean 262 */ 263 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 264 getService().setBeanIdentifier(beanIdentifier); 265 } 266 267 /** 268 * Adds a layout with additional parameters. 269 * 270 * <p> 271 * This method handles the creation of the layout including its resources, 272 * metadata, and internal data structures. It is not necessary to make 273 * subsequent calls to any methods to setup default groups, resources, ... 274 * etc. 275 * </p> 276 * 277 * @param userId the primary key of the user 278 * @param groupId the primary key of the group 279 * @param privateLayout whether the layout is private to the group 280 * @param parentLayoutId the primary key of the parent layout (optionally 281 {@link 282 com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID}) 283 * @param nameMap the layout's locales and localized names 284 * @param titleMap the layout's locales and localized titles 285 * @param descriptionMap the layout's locales and localized descriptions 286 * @param keywordsMap the layout's locales and localized keywords 287 * @param robotsMap the layout's locales and localized robots 288 * @param type the layout's type (optionally {@link 289 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The 290 possible types can be found in {@link 291 com.liferay.portal.model.LayoutConstants}. 292 * @param hidden whether the layout is hidden 293 * @param friendlyURL the layout's friendly URL (optionally {@link 294 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 295 or {@link 296 com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}). 297 The default values can be overridden in 298 <code>portal-ext.properties</code> by specifying new values for 299 the corresponding properties defined in {@link 300 com.liferay.portal.util.PropsValues}. To see how the URL is 301 normalized when accessed see {@link 302 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 303 String)}. 304 * @param serviceContext the service context. Must set the UUID for the 305 layout. Can set the creation date, modification date and the 306 expando bridge attributes for the layout. For layouts that belong 307 to a layout set prototype, an attribute named 'layoutUpdateable' 308 can be set to specify whether site administrators can modify this 309 page within their site. For layouts that are created from a 310 layout prototype, attributes named 'layoutPrototypeUuid' and 311 'layoutPrototypeLinkedEnabled' can be specified to provide the 312 unique identifier of the source prototype and a boolean to 313 determined whether a link to it should be enabled to activate 314 propagation of changes made to the linked page in the prototype. 315 * @return the layout 316 * @throws PortalException if a group or user with the primary key could not 317 be found, or if layout values were invalid 318 * @throws SystemException if a system exception occurred 319 */ 320 public static com.liferay.portal.model.Layout addLayout(long userId, 321 long groupId, boolean privateLayout, long parentLayoutId, 322 java.util.Map<java.util.Locale, java.lang.String> nameMap, 323 java.util.Map<java.util.Locale, java.lang.String> titleMap, 324 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 325 java.util.Map<java.util.Locale, java.lang.String> keywordsMap, 326 java.util.Map<java.util.Locale, java.lang.String> robotsMap, 327 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 328 com.liferay.portal.service.ServiceContext serviceContext) 329 throws com.liferay.portal.kernel.exception.PortalException, 330 com.liferay.portal.kernel.exception.SystemException { 331 return getService() 332 .addLayout(userId, groupId, privateLayout, parentLayoutId, 333 nameMap, titleMap, descriptionMap, keywordsMap, robotsMap, type, 334 hidden, friendlyURL, serviceContext); 335 } 336 337 /** 338 * Adds a layout with single entry maps for name, title, and description to 339 * the default locale. 340 * 341 * <p> 342 * This method handles the creation of the layout including its resources, 343 * metadata, and internal data structures. It is not necessary to make 344 * subsequent calls to any methods to setup default groups, resources, ... 345 * etc. 346 * </p> 347 * 348 * @param userId the primary key of the user 349 * @param groupId the primary key of the group 350 * @param privateLayout whether the layout is private to the group 351 * @param parentLayoutId the primary key of the parent layout (optionally 352 {@link 353 com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID}). 354 The possible values can be found in {@link 355 com.liferay.portal.model.LayoutConstants}. 356 * @param name the layout's name (optionally {@link 357 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME} 358 or {@link 359 com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME}). 360 The default values can be overridden in 361 <code>portal-ext.properties</code> by specifying new values for 362 the corresponding properties defined in {@link 363 com.liferay.portal.util.PropsValues} 364 * @param title the layout's title 365 * @param description the layout's description 366 * @param type the layout's type (optionally {@link 367 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}). The 368 possible types can be found in {@link 369 com.liferay.portal.model.LayoutConstants}. 370 * @param hidden whether the layout is hidden 371 * @param friendlyURL the friendly URL of the layout (optionally {@link 372 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 373 or {@link 374 com.liferay.portal.util.PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL}). 375 The default values can be overridden in 376 <code>portal-ext.properties</code> by specifying new values for 377 the corresponding properties defined in {@link 378 com.liferay.portal.util.PropsValues}. To see how the URL is 379 normalized when accessed see {@link 380 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 381 String)}. 382 * @param serviceContext the service context. Must set the UUID for the 383 layout. Can set the creation date and modification date for the 384 layout. For layouts that belong to a layout set prototype, an 385 attribute named 'layoutUpdateable' can be set to specify whether 386 site administrators can modify this page within their site. 387 * @return the layout 388 * @throws PortalException if a group or user with the primary key could not 389 be found 390 * @throws SystemException if a system exception occurred 391 */ 392 public static com.liferay.portal.model.Layout addLayout(long userId, 393 long groupId, boolean privateLayout, long parentLayoutId, 394 java.lang.String name, java.lang.String title, 395 java.lang.String description, java.lang.String type, boolean hidden, 396 java.lang.String friendlyURL, 397 com.liferay.portal.service.ServiceContext serviceContext) 398 throws com.liferay.portal.kernel.exception.PortalException, 399 com.liferay.portal.kernel.exception.SystemException { 400 return getService() 401 .addLayout(userId, groupId, privateLayout, parentLayoutId, 402 name, title, description, type, hidden, friendlyURL, serviceContext); 403 } 404 405 /** 406 * Deletes the layout, its child layouts, and its associated resources. 407 * 408 * @param layout the layout 409 * @param updateLayoutSet whether the layout set's page counter needs to be 410 updated 411 * @param serviceContext the service context 412 * @throws PortalException if a portal exception occurred 413 * @throws SystemException if a system exception occurred 414 */ 415 public static void deleteLayout(com.liferay.portal.model.Layout layout, 416 boolean updateLayoutSet, 417 com.liferay.portal.service.ServiceContext serviceContext) 418 throws com.liferay.portal.kernel.exception.PortalException, 419 com.liferay.portal.kernel.exception.SystemException { 420 getService().deleteLayout(layout, updateLayoutSet, serviceContext); 421 } 422 423 /** 424 * Deletes the layout with the primary key, also deleting the layout's child 425 * layouts, and associated resources. 426 * 427 * @param groupId the primary key of the group 428 * @param privateLayout whether the layout is private to the group 429 * @param layoutId the primary key of the layout 430 * @param serviceContext the service context 431 * @throws PortalException if a matching layout could not be found , or if 432 some other portal exception occurred 433 * @throws SystemException if a system exception occurred 434 */ 435 public static void deleteLayout(long groupId, boolean privateLayout, 436 long layoutId, com.liferay.portal.service.ServiceContext serviceContext) 437 throws com.liferay.portal.kernel.exception.PortalException, 438 com.liferay.portal.kernel.exception.SystemException { 439 getService() 440 .deleteLayout(groupId, privateLayout, layoutId, serviceContext); 441 } 442 443 /** 444 * Deletes the layout with the plid, also deleting the layout's child 445 * layouts, and associated resources. 446 * 447 * @param plid the primary key of the layout 448 * @param serviceContext the service context 449 * @throws PortalException if a layout with the primary key could not be 450 found , or if some other portal exception occurred 451 * @throws SystemException if a system exception occurred 452 */ 453 public static void deleteLayout(long plid, 454 com.liferay.portal.service.ServiceContext serviceContext) 455 throws com.liferay.portal.kernel.exception.PortalException, 456 com.liferay.portal.kernel.exception.SystemException { 457 getService().deleteLayout(plid, serviceContext); 458 } 459 460 /** 461 * Deletes the group's private or non-private layouts, also deleting the 462 * layouts' child layouts, and associated resources. 463 * 464 * @param groupId the primary key of the group 465 * @param privateLayout whether the layout is private to the group 466 * @param serviceContext the service context 467 * @throws PortalException if a group with the primary key could not be 468 found or if a layout set for the group and privacy could not be 469 found 470 * @throws SystemException if a system exception occurred 471 */ 472 public static void deleteLayouts(long groupId, boolean privateLayout, 473 com.liferay.portal.service.ServiceContext serviceContext) 474 throws com.liferay.portal.kernel.exception.PortalException, 475 com.liferay.portal.kernel.exception.SystemException { 476 getService().deleteLayouts(groupId, privateLayout, serviceContext); 477 } 478 479 /** 480 * Exports layouts with the primary keys and criteria as a byte array. 481 * 482 * @param groupId the primary key of the group 483 * @param privateLayout whether the layout is private to the group 484 * @param layoutIds the primary keys of the layouts to be exported 485 * @param parameterMap the mapping of parameters indicating which 486 information to export. For information on the keys used in the 487 map see {@link 488 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 489 * @param startDate the export's start date 490 * @param endDate the export's end date 491 * @return the layouts as a byte array 492 * @throws PortalException if a group or any layout with the primary key 493 could not be found, or if some other portal exception occurred 494 * @throws SystemException if a system exception occurred 495 */ 496 public static byte[] exportLayouts(long groupId, boolean privateLayout, 497 long[] layoutIds, 498 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 499 java.util.Date startDate, java.util.Date endDate) 500 throws com.liferay.portal.kernel.exception.PortalException, 501 com.liferay.portal.kernel.exception.SystemException { 502 return getService() 503 .exportLayouts(groupId, privateLayout, layoutIds, 504 parameterMap, startDate, endDate); 505 } 506 507 /** 508 * Exports all layouts that match the criteria as a byte array. 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 to export. For information on the keys used in the 514 map see {@link 515 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 516 * @param startDate the export's start date 517 * @param endDate the export's end date 518 * @return the layout as a byte array 519 * @throws PortalException if a group with the primary key could not be 520 found or if some other portal exception occurred 521 * @throws SystemException if a system exception occurred 522 */ 523 public static byte[] exportLayouts(long groupId, boolean privateLayout, 524 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 525 java.util.Date startDate, java.util.Date endDate) 526 throws com.liferay.portal.kernel.exception.PortalException, 527 com.liferay.portal.kernel.exception.SystemException { 528 return getService() 529 .exportLayouts(groupId, privateLayout, parameterMap, 530 startDate, endDate); 531 } 532 533 /** 534 * Exports the layouts that match the primary keys and criteria as a file. 535 * 536 * @param groupId the primary key of the group 537 * @param privateLayout whether the layout is private to the group 538 * @param layoutIds the primary keys of the layouts to be exported 539 (optionally <code>null</code>) 540 * @param parameterMap the mapping of parameters indicating which 541 information to export. For information on the keys used in the 542 map see {@link 543 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 544 * @param startDate the export's start date 545 * @param endDate the export's end date 546 * @return the layouts as a File 547 * @throws PortalException if a group or any layout with the primary key 548 could not be found, or if some other portal exception occurred 549 * @throws SystemException if a system exception occurred 550 */ 551 public static java.io.File exportLayoutsAsFile(long groupId, 552 boolean privateLayout, long[] layoutIds, 553 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 554 java.util.Date startDate, java.util.Date endDate) 555 throws com.liferay.portal.kernel.exception.PortalException, 556 com.liferay.portal.kernel.exception.SystemException { 557 return getService() 558 .exportLayoutsAsFile(groupId, privateLayout, layoutIds, 559 parameterMap, startDate, endDate); 560 } 561 562 /** 563 * Exports the portlet information (categories, permissions, ... etc.) as a 564 * byte array. 565 * 566 * @param plid the primary key of the layout 567 * @param groupId the primary key of the group 568 * @param portletId the primary key of the portlet 569 * @param parameterMap the mapping of parameters indicating which 570 information to export. For information on the keys used in the 571 map see {@link 572 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 573 * @param startDate the export's start date 574 * @param endDate the export's end date 575 * @return the portlet information as a byte array 576 * @throws PortalException if a group or portlet with the primary key could 577 not be found, or if some other portal exception occurred 578 * @throws SystemException if a system exception occurred 579 */ 580 public static byte[] exportPortletInfo(long plid, long groupId, 581 java.lang.String portletId, 582 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 583 java.util.Date startDate, java.util.Date endDate) 584 throws com.liferay.portal.kernel.exception.PortalException, 585 com.liferay.portal.kernel.exception.SystemException { 586 return getService() 587 .exportPortletInfo(plid, groupId, portletId, parameterMap, 588 startDate, endDate); 589 } 590 591 /** 592 * Exports the portlet information (categories, permissions, ... etc.) as a 593 * file. 594 * 595 * @param plid the primary key of the layout 596 * @param groupId the primary key of the group 597 * @param portletId the primary key of the portlet 598 * @param parameterMap the mapping of parameters indicating which 599 information to export. For information on the keys used in the 600 map see {@link 601 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 602 * @param startDate the export's start date 603 * @param endDate the export's end date 604 * @return the portlet information as a file 605 * @throws PortalException if a group or portlet with the primary key could 606 not be found, or if some other portal exception occurred 607 * @throws SystemException if a system exception occurred 608 */ 609 public static java.io.File exportPortletInfoAsFile(long plid, long groupId, 610 java.lang.String portletId, 611 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 612 java.util.Date startDate, java.util.Date endDate) 613 throws com.liferay.portal.kernel.exception.PortalException, 614 com.liferay.portal.kernel.exception.SystemException { 615 return getService() 616 .exportPortletInfoAsFile(plid, groupId, portletId, 617 parameterMap, startDate, endDate); 618 } 619 620 public static com.liferay.portal.model.Layout fetchFirstLayout( 621 long groupId, boolean privateLayout, long parentLayoutId) 622 throws com.liferay.portal.kernel.exception.SystemException { 623 return getService() 624 .fetchFirstLayout(groupId, privateLayout, parentLayoutId); 625 } 626 627 public static com.liferay.portal.model.Layout fetchLayout(long groupId, 628 boolean privateLayout, long layoutId) 629 throws com.liferay.portal.kernel.exception.SystemException { 630 return getService().fetchLayout(groupId, privateLayout, layoutId); 631 } 632 633 /** 634 * @param uuid the layout's UUID 635 * @param groupId the primary key of the group 636 * @param privateLayout whether the layout is private to the group 637 * @return the layout, or <code>null</code> if a matching layout could not 638 be found 639 * @throws SystemException if a system exception occurred 640 */ 641 public static com.liferay.portal.model.Layout fetchLayoutByUuidAndGroupId( 642 java.lang.String uuid, long groupId, boolean privateLayout) 643 throws com.liferay.portal.kernel.exception.SystemException { 644 return getService() 645 .fetchLayoutByUuidAndGroupId(uuid, groupId, privateLayout); 646 } 647 648 /** 649 * Returns the primary key of the default layout for the group 650 * 651 * @param groupId the primary key of the group 652 * @return the primary key of the default layout for the group (optionally 653 {@link com.liferay.portal.model.LayoutConstants#DEFAULT_PLID}) 654 * @throws SystemException if a system exception occurred 655 */ 656 public static long getDefaultPlid(long groupId) 657 throws com.liferay.portal.kernel.exception.SystemException { 658 return getService().getDefaultPlid(groupId); 659 } 660 661 /** 662 * Returns primary key of the matching default layout for the group 663 * 664 * @param groupId the primary key of the group 665 * @param privateLayout whether the layout is private to the group 666 * @return the primary key of the default layout for the group; {@link 667 com.liferay.portal.model.LayoutConstants#DEFAULT_PLID}) otherwise 668 * @throws SystemException if a system exception occurred 669 */ 670 public static long getDefaultPlid(long groupId, boolean privateLayout) 671 throws com.liferay.portal.kernel.exception.SystemException { 672 return getService().getDefaultPlid(groupId, privateLayout); 673 } 674 675 /** 676 * Returns primary key of the default portlet layout for the group 677 * 678 * @param groupId the primary key of the group 679 * @param privateLayout whether the layout is private to the group 680 * @param portletId the primary key of the portlet 681 * @return the primary key of the default portlet layout for the group; 682 {@link com.liferay.portal.model.LayoutConstants#DEFAULT_PLID} 683 otherwise 684 * @throws PortalException if a portlet with the primary key could not be 685 found 686 * @throws SystemException if a system exception occurred 687 */ 688 public static long getDefaultPlid(long groupId, boolean privateLayout, 689 java.lang.String portletId) 690 throws com.liferay.portal.kernel.exception.PortalException, 691 com.liferay.portal.kernel.exception.SystemException { 692 return getService().getDefaultPlid(groupId, privateLayout, portletId); 693 } 694 695 /** 696 * Returns the layout for the friendly URL 697 * 698 * @param groupId the primary key of the group 699 * @param privateLayout whether the layout is private to the group 700 * @param friendlyURL the friendly URL of the layout 701 * @return the layout for the friendly URL 702 * @throws PortalException if the friendly URL is <code>null</code> or a 703 matching layout could not be found 704 * @throws SystemException if a system exception occurred 705 */ 706 public static com.liferay.portal.model.Layout getFriendlyURLLayout( 707 long groupId, boolean privateLayout, java.lang.String friendlyURL) 708 throws com.liferay.portal.kernel.exception.PortalException, 709 com.liferay.portal.kernel.exception.SystemException { 710 return getService() 711 .getFriendlyURLLayout(groupId, privateLayout, friendlyURL); 712 } 713 714 /** 715 * Returns the layout matching the primary key, group, and privacy; throws a 716 * {@link com.liferay.portal.NoSuchLayoutException} otherwise. 717 * 718 * @param groupId the primary key of the group 719 * @param privateLayout whether the layout is private to the group 720 * @param layoutId the primary key of the layout 721 * @return the matching layout 722 * @throws PortalException if a matching layout could not be found 723 * @throws SystemException if a system exception occurred 724 */ 725 public static com.liferay.portal.model.Layout getLayout(long groupId, 726 boolean privateLayout, long layoutId) 727 throws com.liferay.portal.kernel.exception.PortalException, 728 com.liferay.portal.kernel.exception.SystemException { 729 return getService().getLayout(groupId, privateLayout, layoutId); 730 } 731 732 /** 733 * Returns the layout for the icon image; throws a {@link 734 * com.liferay.portal.NoSuchLayoutException} otherwise. 735 * 736 * @param iconImageId the primary key of the icon image 737 * @return Returns the layout for the icon image 738 * @throws PortalException if an icon image with the primary key could not 739 be found 740 * @throws SystemException if a system exception occurred 741 */ 742 public static com.liferay.portal.model.Layout getLayoutByIconImageId( 743 long iconImageId) 744 throws com.liferay.portal.kernel.exception.PortalException, 745 com.liferay.portal.kernel.exception.SystemException { 746 return getService().getLayoutByIconImageId(iconImageId); 747 } 748 749 /** 750 * Returns all the layouts belonging to the group. 751 * 752 * @param groupId the primary key of the group 753 * @param privateLayout whether the layout is private to the group 754 * @return the matching layouts, or <code>null</code> if no matches were 755 found 756 * @throws SystemException if a system exception occurred 757 */ 758 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 759 long groupId, boolean privateLayout) 760 throws com.liferay.portal.kernel.exception.SystemException { 761 return getService().getLayouts(groupId, privateLayout); 762 } 763 764 /** 765 * Returns all the layouts belonging to the group that are children of the 766 * parent layout. 767 * 768 * @param groupId the primary key of the group 769 * @param privateLayout whether the layout is private to the group 770 * @param parentLayoutId the primary key of the parent layout 771 * @return the matching layouts, or <code>null</code> if no matches were 772 found 773 * @throws SystemException if a system exception occurred 774 */ 775 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 776 long groupId, boolean privateLayout, long parentLayoutId) 777 throws com.liferay.portal.kernel.exception.SystemException { 778 return getService().getLayouts(groupId, privateLayout, parentLayoutId); 779 } 780 781 /** 782 * Returns a range of all the layouts belonging to the group that are 783 * children of the parent layout. 784 * 785 * <p> 786 * Useful when paginating results. Returns a maximum of <code>end - 787 * start</code> instances. <code>start</code> and <code>end</code> are not 788 * primary keys, they are indexes in the result set. Thus, <code>0</code> 789 * refers to the first result in the set. Setting both <code>start</code> 790 * and <code>end</code> to {@link 791 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 792 * result set. 793 * </p> 794 * 795 * @param groupId the primary key of the group 796 * @param privateLayout whether the layout is private to the group 797 * @param parentLayoutId the primary key of the parent layout 798 * @param incomplete whether the layout is incomplete 799 * @param start the lower bound of the range of layouts 800 * @param end the upper bound of the range of layouts (not inclusive) 801 * @return the matching layouts, or <code>null</code> if no matches were 802 found 803 * @throws SystemException if a system exception occurred 804 */ 805 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 806 long groupId, boolean privateLayout, long parentLayoutId, 807 boolean incomplete, int start, int end) 808 throws com.liferay.portal.kernel.exception.SystemException { 809 return getService() 810 .getLayouts(groupId, privateLayout, parentLayoutId, 811 incomplete, start, end); 812 } 813 814 /** 815 * Returns all the layouts that match the layout IDs and belong to the 816 * group. 817 * 818 * @param groupId the primary key of the group 819 * @param privateLayout whether the layout is private to the group 820 * @param layoutIds the primary keys of the layouts 821 * @return the matching layouts, or <code>null</code> if no matches were 822 found 823 * @throws PortalException if a group or layout with the primary key could 824 not be found 825 * @throws SystemException if a system exception occurred 826 */ 827 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 828 long groupId, boolean privateLayout, long[] layoutIds) 829 throws com.liferay.portal.kernel.exception.PortalException, 830 com.liferay.portal.kernel.exception.SystemException { 831 return getService().getLayouts(groupId, privateLayout, layoutIds); 832 } 833 834 /** 835 * Returns all the layouts that match the type and belong to the group. 836 * 837 * @param groupId the primary key of the group 838 * @param privateLayout whether the layout is private to the group 839 * @param type the type of the layouts (optionally {@link 840 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}) 841 * @return the matching layouts, or <code>null</code> if no matches were 842 found 843 * @throws SystemException if a system exception occurred 844 */ 845 public static java.util.List<com.liferay.portal.model.Layout> getLayouts( 846 long groupId, boolean privateLayout, java.lang.String type) 847 throws com.liferay.portal.kernel.exception.SystemException { 848 return getService().getLayouts(groupId, privateLayout, type); 849 } 850 851 /** 852 * Returns the layout references for all the layouts that belong to the 853 * company and belong to the portlet that matches the preferences. 854 * 855 * @param companyId the primary key of the company 856 * @param portletId the primary key of the portlet 857 * @param preferencesKey the portlet's preference key 858 * @param preferencesValue the portlet's preference value 859 * @return the layout references of the matching layouts 860 * @throws SystemException if a system exception occurred 861 */ 862 public static com.liferay.portal.model.LayoutReference[] getLayouts( 863 long companyId, java.lang.String portletId, 864 java.lang.String preferencesKey, java.lang.String preferencesValue) 865 throws com.liferay.portal.kernel.exception.SystemException { 866 return getService() 867 .getLayouts(companyId, portletId, preferencesKey, 868 preferencesValue); 869 } 870 871 public static int getLayoutsByLayoutPrototypeUuidCount( 872 java.lang.String layoutPrototypeUuid) 873 throws com.liferay.portal.kernel.exception.SystemException { 874 return getService() 875 .getLayoutsByLayoutPrototypeUuidCount(layoutPrototypeUuid); 876 } 877 878 public static int getLayoutsCount(com.liferay.portal.model.Group group, 879 boolean privateLayout) 880 throws com.liferay.portal.kernel.exception.PortalException, 881 com.liferay.portal.kernel.exception.SystemException { 882 return getService().getLayoutsCount(group, privateLayout); 883 } 884 885 public static int getLayoutsCount(com.liferay.portal.model.Group group, 886 boolean privateLayout, boolean includeUserGroups) 887 throws com.liferay.portal.kernel.exception.PortalException, 888 com.liferay.portal.kernel.exception.SystemException { 889 return getService() 890 .getLayoutsCount(group, privateLayout, includeUserGroups); 891 } 892 893 public static int getLayoutsCount(com.liferay.portal.model.User user, 894 boolean privateLayout) 895 throws com.liferay.portal.kernel.exception.PortalException, 896 com.liferay.portal.kernel.exception.SystemException { 897 return getService().getLayoutsCount(user, privateLayout); 898 } 899 900 public static int getLayoutsCount(com.liferay.portal.model.User user, 901 boolean privateLayout, boolean includeUserGroups) 902 throws com.liferay.portal.kernel.exception.PortalException, 903 com.liferay.portal.kernel.exception.SystemException { 904 return getService() 905 .getLayoutsCount(user, privateLayout, includeUserGroups); 906 } 907 908 /** 909 * Returns the primary key to use for the next layout. 910 * 911 * @param groupId the primary key of the group 912 * @param privateLayout whether the layout is private to the group 913 * @return the primary key to use for the next layout 914 * @throws SystemException if a system exception occurred 915 */ 916 public static long getNextLayoutId(long groupId, boolean privateLayout) 917 throws com.liferay.portal.kernel.exception.SystemException { 918 return getService().getNextLayoutId(groupId, privateLayout); 919 } 920 921 /** 922 * Returns all the layouts without resource permissions 923 * 924 * @param roleId the primary key of the role 925 * @return all the layouts without resource permissions 926 * @throws SystemException if a system exception occurred 927 */ 928 public static java.util.List<com.liferay.portal.model.Layout> getNoPermissionLayouts( 929 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 930 return getService().getNoPermissionLayouts(roleId); 931 } 932 933 /** 934 * Returns all the layouts whose friendly URLs are <code>null</code> 935 * 936 * @return all the layouts whose friendly URLs are <code>null</code> 937 * @throws SystemException if a system exception occurred 938 */ 939 public static java.util.List<com.liferay.portal.model.Layout> getNullFriendlyURLLayouts() 940 throws com.liferay.portal.kernel.exception.SystemException { 941 return getService().getNullFriendlyURLLayouts(); 942 } 943 944 /** 945 * Returns all the layouts within scope of the group 946 * 947 * @param groupId the primary key of the group 948 * @param privateLayout whether the layout is private to the group 949 * @return the layouts within scope of the group 950 * @throws SystemException if a system exception occurred 951 */ 952 public static java.util.List<com.liferay.portal.model.Layout> getScopeGroupLayouts( 953 long groupId, boolean privateLayout) 954 throws com.liferay.portal.kernel.exception.SystemException { 955 return getService().getScopeGroupLayouts(groupId, privateLayout); 956 } 957 958 public static boolean hasLayouts(com.liferay.portal.model.Group group, 959 boolean privateLayout) 960 throws com.liferay.portal.kernel.exception.PortalException, 961 com.liferay.portal.kernel.exception.SystemException { 962 return getService().hasLayouts(group, privateLayout); 963 } 964 965 public static boolean hasLayouts(com.liferay.portal.model.Group group, 966 boolean privateLayout, boolean includeUserGroups) 967 throws com.liferay.portal.kernel.exception.PortalException, 968 com.liferay.portal.kernel.exception.SystemException { 969 return getService().hasLayouts(group, privateLayout, includeUserGroups); 970 } 971 972 /** 973 * Returns <code>true</code> if the group has any layouts; 974 * <code>false</code> otherwise. 975 * 976 * @param groupId the primary key of the group 977 * @param privateLayout whether the layout is private to the group 978 * @param parentLayoutId the primary key of the parent layout 979 * @return <code>true</code> if the group has any layouts; 980 <code>false</code> otherwise 981 * @throws SystemException if a system exception occurred 982 */ 983 public static boolean hasLayouts(long groupId, boolean privateLayout, 984 long parentLayoutId) 985 throws com.liferay.portal.kernel.exception.SystemException { 986 return getService().hasLayouts(groupId, privateLayout, parentLayoutId); 987 } 988 989 public static boolean hasLayouts(com.liferay.portal.model.User user, 990 boolean privateLayout) 991 throws com.liferay.portal.kernel.exception.PortalException, 992 com.liferay.portal.kernel.exception.SystemException { 993 return getService().hasLayouts(user, privateLayout); 994 } 995 996 public static boolean hasLayouts(com.liferay.portal.model.User user, 997 boolean privateLayout, boolean includeUserGroups) 998 throws com.liferay.portal.kernel.exception.PortalException, 999 com.liferay.portal.kernel.exception.SystemException { 1000 return getService().hasLayouts(user, privateLayout, includeUserGroups); 1001 } 1002 1003 public static boolean hasLayoutSetPrototypeLayout( 1004 long layoutSetPrototypeId, java.lang.String layoutUuid) 1005 throws com.liferay.portal.kernel.exception.PortalException, 1006 com.liferay.portal.kernel.exception.SystemException { 1007 return getService() 1008 .hasLayoutSetPrototypeLayout(layoutSetPrototypeId, layoutUuid); 1009 } 1010 1011 public static boolean hasLayoutSetPrototypeLayout( 1012 java.lang.String layoutSetPrototypeUuid, long companyId, 1013 java.lang.String layoutUuid) 1014 throws com.liferay.portal.kernel.exception.PortalException, 1015 com.liferay.portal.kernel.exception.SystemException { 1016 return getService() 1017 .hasLayoutSetPrototypeLayout(layoutSetPrototypeUuid, 1018 companyId, layoutUuid); 1019 } 1020 1021 /** 1022 * Imports the layouts from the byte array. 1023 * 1024 * @param userId the primary key of the user 1025 * @param groupId the primary key of the group 1026 * @param privateLayout whether the layout is private to the group 1027 * @param parameterMap the mapping of parameters indicating which 1028 information will be imported. For information on the keys used in 1029 the map see {@link 1030 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 1031 * @param bytes the byte array with the data 1032 * @throws PortalException if a group or user with the primary key could not 1033 be found, or if some other portal exception occurred 1034 * @throws SystemException if a system exception occurred 1035 * @see com.liferay.portal.lar.LayoutImporter 1036 */ 1037 public static void importLayouts(long userId, long groupId, 1038 boolean privateLayout, 1039 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1040 byte[] bytes) 1041 throws com.liferay.portal.kernel.exception.PortalException, 1042 com.liferay.portal.kernel.exception.SystemException { 1043 getService() 1044 .importLayouts(userId, groupId, privateLayout, parameterMap, bytes); 1045 } 1046 1047 /** 1048 * Imports the layouts from the file. 1049 * 1050 * @param userId the primary key of the user 1051 * @param groupId the primary key of the group 1052 * @param privateLayout whether the layout is private to the group 1053 * @param parameterMap the mapping of parameters indicating which 1054 information will be imported. For information on the keys used in 1055 the map see {@link 1056 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 1057 * @param file the LAR file with the data 1058 * @throws PortalException if a group or user with the primary key could not 1059 be found, or if some other portal exception occurred 1060 * @throws SystemException if a system exception occurred 1061 * @see com.liferay.portal.lar.LayoutImporter 1062 */ 1063 public static void importLayouts(long userId, long groupId, 1064 boolean privateLayout, 1065 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1066 java.io.File file) 1067 throws com.liferay.portal.kernel.exception.PortalException, 1068 com.liferay.portal.kernel.exception.SystemException { 1069 getService() 1070 .importLayouts(userId, groupId, privateLayout, parameterMap, file); 1071 } 1072 1073 /** 1074 * Imports the layouts from the input stream. 1075 * 1076 * @param userId the primary key of the user 1077 * @param groupId the primary key of the group 1078 * @param privateLayout whether the layout is private to the group 1079 * @param parameterMap the mapping of parameters indicating which 1080 information will be imported. For information on the keys used in 1081 the map see {@link 1082 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 1083 * @param is the input stream 1084 * @throws PortalException if a group or user with the primary key could not 1085 be found, or if some other portal exception occurred 1086 * @throws SystemException if a system exception occurred 1087 * @see com.liferay.portal.lar.LayoutImporter 1088 */ 1089 public static void importLayouts(long userId, long groupId, 1090 boolean privateLayout, 1091 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1092 java.io.InputStream is) 1093 throws com.liferay.portal.kernel.exception.PortalException, 1094 com.liferay.portal.kernel.exception.SystemException { 1095 getService() 1096 .importLayouts(userId, groupId, privateLayout, parameterMap, is); 1097 } 1098 1099 /** 1100 * Imports the portlet information (categories, permissions, ... etc.) from 1101 * the file. 1102 * 1103 * @param userId the primary key of the user 1104 * @param plid the primary key of the target layout 1105 * @param groupId the primary key of the target group 1106 * @param portletId the primary key of the portlet 1107 * @param parameterMap the mapping of parameters indicating which 1108 information will be imported. For information on the keys used in 1109 the map see {@link 1110 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 1111 * @param file the LAR file with the data 1112 * @throws PortalException if a group, layout, portlet or user with the 1113 primary key could not be found 1114 * @throws SystemException if a system exception occurred 1115 */ 1116 public static void importPortletInfo(long userId, long plid, long groupId, 1117 java.lang.String portletId, 1118 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1119 java.io.File file) 1120 throws com.liferay.portal.kernel.exception.PortalException, 1121 com.liferay.portal.kernel.exception.SystemException { 1122 getService() 1123 .importPortletInfo(userId, plid, groupId, portletId, parameterMap, 1124 file); 1125 } 1126 1127 /** 1128 * Imports the portlet information (categories, permissions, ... etc.) from 1129 * the input stream. 1130 * 1131 * @param userId the primary key of the user 1132 * @param plid the primary key of the layout 1133 * @param groupId the primary key of the group 1134 * @param portletId the primary key of the portlet 1135 * @param parameterMap the mapping of parameters indicating which 1136 information will be imported. For information on the keys used in 1137 the map see {@link 1138 com.liferay.portal.kernel.lar.PortletDataHandlerKeys}. 1139 * @param is the input stream 1140 * @throws PortalException if a group, portlet, layout or user with the 1141 primary key could not be found 1142 * @throws SystemException if a system exception occurred 1143 */ 1144 public static void importPortletInfo(long userId, long plid, long groupId, 1145 java.lang.String portletId, 1146 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1147 java.io.InputStream is) 1148 throws com.liferay.portal.kernel.exception.PortalException, 1149 com.liferay.portal.kernel.exception.SystemException { 1150 getService() 1151 .importPortletInfo(userId, plid, groupId, portletId, parameterMap, 1152 is); 1153 } 1154 1155 /** 1156 * Sets the layouts for the group, replacing and prioritizing all layouts of 1157 * the parent layout. 1158 * 1159 * @param groupId the primary key of the group 1160 * @param privateLayout whether the layout is private to the group 1161 * @param parentLayoutId the primary key of the parent layout 1162 * @param layoutIds the primary keys of the layouts 1163 * @param serviceContext the service context 1164 * @throws PortalException if a group or layout with the primary key could 1165 not be found, if no layouts were specified, if the first layout 1166 was not page-able, if the first layout was hidden, or if some 1167 other portal exception occurred 1168 * @throws SystemException if a system exception occurred 1169 */ 1170 public static void setLayouts(long groupId, boolean privateLayout, 1171 long parentLayoutId, long[] layoutIds, 1172 com.liferay.portal.service.ServiceContext serviceContext) 1173 throws com.liferay.portal.kernel.exception.PortalException, 1174 com.liferay.portal.kernel.exception.SystemException { 1175 getService() 1176 .setLayouts(groupId, privateLayout, parentLayoutId, layoutIds, 1177 serviceContext); 1178 } 1179 1180 /** 1181 * Updates the friendly URL of the layout. 1182 * 1183 * @param plid the primary key of the layout 1184 * @param friendlyURL the friendly URL to be assigned 1185 * @return the updated layout 1186 * @throws PortalException if a group or layout with the primary key could 1187 not be found 1188 * @throws SystemException if a system exception occurred 1189 */ 1190 public static com.liferay.portal.model.Layout updateFriendlyURL(long plid, 1191 java.lang.String friendlyURL) 1192 throws com.liferay.portal.kernel.exception.PortalException, 1193 com.liferay.portal.kernel.exception.SystemException { 1194 return getService().updateFriendlyURL(plid, friendlyURL); 1195 } 1196 1197 /** 1198 * Updates the layout. 1199 * 1200 * @param groupId the primary key of the group 1201 * @param privateLayout whether the layout is private to the group 1202 * @param layoutId the primary key of the layout 1203 * @param parentLayoutId the primary key of the layout's new parent layout 1204 * @param nameMap the locales and localized names to merge (optionally 1205 <code>null</code>) 1206 * @param titleMap the locales and localized titles to merge (optionally 1207 <code>null</code>) 1208 * @param descriptionMap the locales and localized descriptions to merge 1209 (optionally <code>null</code>) 1210 * @param keywordsMap the locales and localized keywords to merge 1211 (optionally <code>null</code>) 1212 * @param robotsMap the locales and localized robots to merge (optionally 1213 <code>null</code>) 1214 * @param type the layout's new type (optionally {@link 1215 com.liferay.portal.model.LayoutConstants#TYPE_PORTLET}) 1216 * @param hidden whether the layout is hidden 1217 * @param friendlyURL the layout's new friendly URL (optionally {@link 1218 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL} 1219 or {@link 1220 com.liferay.portal.util.PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL}). 1221 The default values can be overridden in 1222 <code>portal-ext.properties</code> by specifying new values for 1223 the corresponding properties defined in {@link 1224 com.liferay.portal.util.PropsValues}. To see how the URL is 1225 normalized when accessed see {@link 1226 com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil#normalize( 1227 String)}. 1228 * @param iconImage whether the icon image will be updated 1229 * @param iconBytes the byte array of the layout's new icon image 1230 * @param serviceContext the service context. Can set the modification date 1231 and expando bridge attributes for the layout. For layouts that 1232 are linked to a layout prototype, attributes named 1233 'layoutPrototypeUuid' and 'layoutPrototypeLinkedEnabled' can be 1234 specified to provide the unique identifier of the source 1235 prototype and a boolean to determined whether a link to it should 1236 be enabled to activate propagation of changes made to the linked 1237 page in the prototype. 1238 * @return the updated layout 1239 * @throws PortalException if a group or layout with the primary key could 1240 not be found, if a unique friendly URL could not be generated, if 1241 a valid parent layout ID to use could not be found, or if the 1242 layout parameters were invalid 1243 * @throws SystemException if a system exception occurred 1244 */ 1245 public static com.liferay.portal.model.Layout updateLayout(long groupId, 1246 boolean privateLayout, long layoutId, long parentLayoutId, 1247 java.util.Map<java.util.Locale, java.lang.String> nameMap, 1248 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1249 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1250 java.util.Map<java.util.Locale, java.lang.String> keywordsMap, 1251 java.util.Map<java.util.Locale, java.lang.String> robotsMap, 1252 java.lang.String type, boolean hidden, java.lang.String friendlyURL, 1253 java.lang.Boolean iconImage, byte[] iconBytes, 1254 com.liferay.portal.service.ServiceContext serviceContext) 1255 throws com.liferay.portal.kernel.exception.PortalException, 1256 com.liferay.portal.kernel.exception.SystemException { 1257 return getService() 1258 .updateLayout(groupId, privateLayout, layoutId, 1259 parentLayoutId, nameMap, titleMap, descriptionMap, keywordsMap, 1260 robotsMap, type, hidden, friendlyURL, iconImage, iconBytes, 1261 serviceContext); 1262 } 1263 1264 /** 1265 * Updates the layout replacing its type settings. 1266 * 1267 * @param groupId the primary key of the group 1268 * @param privateLayout whether the layout is private to the group 1269 * @param layoutId the primary key of the layout 1270 * @param typeSettings the settings to load the unicode properties object. 1271 See {@link com.liferay.portal.kernel.util.UnicodeProperties 1272 #fastLoad(String)}. 1273 * @return the updated layout 1274 * @throws PortalException if a matching layout could not be found 1275 * @throws SystemException if a system exception occurred 1276 */ 1277 public static com.liferay.portal.model.Layout updateLayout(long groupId, 1278 boolean privateLayout, long layoutId, java.lang.String typeSettings) 1279 throws com.liferay.portal.kernel.exception.PortalException, 1280 com.liferay.portal.kernel.exception.SystemException { 1281 return getService() 1282 .updateLayout(groupId, privateLayout, layoutId, typeSettings); 1283 } 1284 1285 /** 1286 * Updates the look and feel of the layout. 1287 * 1288 * @param groupId the primary key of the group 1289 * @param privateLayout whether the layout is private to the group 1290 * @param layoutId the primary key of the layout 1291 * @param themeId the primary key of the layout's new theme 1292 * @param colorSchemeId the primary key of the layout's new color scheme 1293 * @param css the layout's new CSS 1294 * @param wapTheme whether the theme is for WAP browsers 1295 * @return the updated layout 1296 * @throws PortalException if a matching layout could not be found 1297 * @throws SystemException if a system exception occurred 1298 */ 1299 public static com.liferay.portal.model.Layout updateLookAndFeel( 1300 long groupId, boolean privateLayout, long layoutId, 1301 java.lang.String themeId, java.lang.String colorSchemeId, 1302 java.lang.String css, boolean wapTheme) 1303 throws com.liferay.portal.kernel.exception.PortalException, 1304 com.liferay.portal.kernel.exception.SystemException { 1305 return getService() 1306 .updateLookAndFeel(groupId, privateLayout, layoutId, 1307 themeId, colorSchemeId, css, wapTheme); 1308 } 1309 1310 /** 1311 * Updates the name of the layout. 1312 * 1313 * @param layout the layout to be updated 1314 * @param name the layout's new name 1315 * @param languageId the primary key of the language. For more information 1316 see {@link java.util.Locale}. 1317 * @return the updated layout 1318 * @throws PortalException if the new name was <code>null</code> 1319 * @throws SystemException if a system exception occurred 1320 */ 1321 public static com.liferay.portal.model.Layout updateName( 1322 com.liferay.portal.model.Layout layout, java.lang.String name, 1323 java.lang.String languageId) 1324 throws com.liferay.portal.kernel.exception.PortalException, 1325 com.liferay.portal.kernel.exception.SystemException { 1326 return getService().updateName(layout, name, languageId); 1327 } 1328 1329 /** 1330 * Updates the name of the layout matching the group, layout ID, and 1331 * privacy. 1332 * 1333 * @param groupId the primary key of the group 1334 * @param privateLayout whether the layout is private to the group 1335 * @param layoutId the primary key of the layout 1336 * @param name the layout's new name 1337 * @param languageId the primary key of the language. For more information 1338 see {@link java.util.Locale}. 1339 * @return the updated layout 1340 * @throws PortalException if a matching layout could not be found or if the 1341 new name was <code>null</code> 1342 * @throws SystemException if a system exception occurred 1343 */ 1344 public static com.liferay.portal.model.Layout updateName(long groupId, 1345 boolean privateLayout, long layoutId, java.lang.String name, 1346 java.lang.String languageId) 1347 throws com.liferay.portal.kernel.exception.PortalException, 1348 com.liferay.portal.kernel.exception.SystemException { 1349 return getService() 1350 .updateName(groupId, privateLayout, layoutId, name, 1351 languageId); 1352 } 1353 1354 /** 1355 * Updates the name of the layout matching the primary key. 1356 * 1357 * @param plid the primary key of the layout 1358 * @param name the name to be assigned 1359 * @param languageId the primary key of the language. For more information 1360 see {@link java.util.Locale}. 1361 * @return the updated layout 1362 * @throws PortalException if a layout with the primary key could not be 1363 found or if the name was <code>null</code> 1364 * @throws SystemException if a system exception occurred 1365 */ 1366 public static com.liferay.portal.model.Layout updateName(long plid, 1367 java.lang.String name, java.lang.String languageId) 1368 throws com.liferay.portal.kernel.exception.PortalException, 1369 com.liferay.portal.kernel.exception.SystemException { 1370 return getService().updateName(plid, name, languageId); 1371 } 1372 1373 /** 1374 * Updates the parent layout ID of the layout matching the group, layout ID, 1375 * and privacy. 1376 * 1377 * @param groupId the primary key of the group 1378 * @param privateLayout whether the layout is private to the group 1379 * @param layoutId the primary key of the layout 1380 * @param parentLayoutId the primary key to be assigned to the parent 1381 layout 1382 * @return the matching layout 1383 * @throws PortalException if a valid parent layout ID to use could not be 1384 found or if a matching layout could not be found 1385 * @throws SystemException if a system exception occurred 1386 */ 1387 public static com.liferay.portal.model.Layout updateParentLayoutId( 1388 long groupId, boolean privateLayout, long layoutId, long parentLayoutId) 1389 throws com.liferay.portal.kernel.exception.PortalException, 1390 com.liferay.portal.kernel.exception.SystemException { 1391 return getService() 1392 .updateParentLayoutId(groupId, privateLayout, layoutId, 1393 parentLayoutId); 1394 } 1395 1396 /** 1397 * Updates the parent layout ID of the layout matching the primary key. If a 1398 * layout matching the parent primary key is found, the layout ID of that 1399 * layout is assigned, otherwise {@link 1400 * com.liferay.portal.model.LayoutConstants#DEFAULT_PARENT_LAYOUT_ID} is 1401 * assigned. 1402 * 1403 * @param plid the primary key of the layout 1404 * @param parentPlid the primary key of the parent layout 1405 * @return the layout matching the primary key 1406 * @throws PortalException if a layout with the primary key could not be 1407 found or if a valid parent layout ID to use could not be found 1408 * @throws SystemException if a system exception occurred 1409 */ 1410 public static com.liferay.portal.model.Layout updateParentLayoutId( 1411 long plid, long parentPlid) 1412 throws com.liferay.portal.kernel.exception.PortalException, 1413 com.liferay.portal.kernel.exception.SystemException { 1414 return getService().updateParentLayoutId(plid, parentPlid); 1415 } 1416 1417 /** 1418 * Updates the priorities of the layouts. 1419 * 1420 * @param groupId the primary key of the group 1421 * @param privateLayout whether the layout is private to the group 1422 * @throws PortalException if a matching layout could not be found 1423 * @throws SystemException if a system exception occurred 1424 */ 1425 public static void updatePriorities(long groupId, boolean privateLayout) 1426 throws com.liferay.portal.kernel.exception.PortalException, 1427 com.liferay.portal.kernel.exception.SystemException { 1428 getService().updatePriorities(groupId, privateLayout); 1429 } 1430 1431 /** 1432 * Updates the priority of the layout. 1433 * 1434 * @param layout the layout to be updated 1435 * @param priority the layout's new priority 1436 * @return the updated layout 1437 * @throws SystemException if a system exception occurred 1438 */ 1439 public static com.liferay.portal.model.Layout updatePriority( 1440 com.liferay.portal.model.Layout layout, int priority) 1441 throws com.liferay.portal.kernel.exception.SystemException { 1442 return getService().updatePriority(layout, priority); 1443 } 1444 1445 /** 1446 * Updates the priority of the layout matching the group, layout ID, and 1447 * privacy. 1448 * 1449 * @param groupId the primary key of the group 1450 * @param privateLayout whether the layout is private to the group 1451 * @param layoutId the primary key of the layout 1452 * @param priority the layout's new priority 1453 * @return the updated layout 1454 * @throws PortalException if a matching layout could not be found 1455 * @throws SystemException if a system exception occurred 1456 */ 1457 public static com.liferay.portal.model.Layout updatePriority(long groupId, 1458 boolean privateLayout, long layoutId, int priority) 1459 throws com.liferay.portal.kernel.exception.PortalException, 1460 com.liferay.portal.kernel.exception.SystemException { 1461 return getService() 1462 .updatePriority(groupId, privateLayout, layoutId, priority); 1463 } 1464 1465 /** 1466 * Updates the priority of the layout matching the primary key. 1467 * 1468 * @param plid the primary key of the layout 1469 * @param priority the layout's new priority 1470 * @return the updated layout 1471 * @throws PortalException if a layout with the primary key could not be 1472 found 1473 * @throws SystemException if a system exception occurred 1474 */ 1475 public static com.liferay.portal.model.Layout updatePriority(long plid, 1476 int priority) 1477 throws com.liferay.portal.kernel.exception.PortalException, 1478 com.liferay.portal.kernel.exception.SystemException { 1479 return getService().updatePriority(plid, priority); 1480 } 1481 1482 public static void updateScopedPortletNames(long groupId, 1483 boolean privateLayout, long layoutId, 1484 java.util.Map<java.util.Locale, java.lang.String> nameMap, 1485 java.util.List<java.util.Locale> nameMapModifiedLocales) 1486 throws com.liferay.portal.kernel.exception.PortalException, 1487 com.liferay.portal.kernel.exception.SystemException { 1488 getService() 1489 .updateScopedPortletNames(groupId, privateLayout, layoutId, 1490 nameMap, nameMapModifiedLocales); 1491 } 1492 1493 /** 1494 * Updates the names of the portlets within scope of the group, the scope of 1495 * the layout's UUID, and the privacy. 1496 * 1497 * @param groupId the primary key of the group 1498 * @param privateLayout whether the layout is private to the group 1499 * @param layoutId the primary key of the layout whose UUID to match 1500 * @param name the new name for the portlets 1501 * @param languageId the primary key of the language 1502 * @throws PortalException if a matching layout could not be found 1503 * @throws SystemException if a system exception occurred 1504 * @see com.liferay.portlet.portletconfiguration.action.EditScopeAction 1505 */ 1506 public static void updateScopedPortletNames(long groupId, 1507 boolean privateLayout, long layoutId, java.lang.String name, 1508 java.lang.String languageId) 1509 throws com.liferay.portal.kernel.exception.PortalException, 1510 com.liferay.portal.kernel.exception.SystemException { 1511 getService() 1512 .updateScopedPortletNames(groupId, privateLayout, layoutId, name, 1513 languageId); 1514 } 1515 1516 public static LayoutLocalService getService() { 1517 if (_service == null) { 1518 _service = (LayoutLocalService)PortalBeanLocatorUtil.locate(LayoutLocalService.class.getName()); 1519 1520 ReferenceRegistry.registerReference(LayoutLocalServiceUtil.class, 1521 "_service"); 1522 } 1523 1524 return _service; 1525 } 1526 1527 /** 1528 * @deprecated 1529 */ 1530 public void setService(LayoutLocalService service) { 1531 } 1532 1533 private static LayoutLocalService _service; 1534 }