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