Interface LayoutLocalService
- All Superinterfaces:
BaseLocalService
,CTService<Layout>
,PersistedModelLocalService
- All Known Implementing Classes:
LayoutLocalServiceWrapper
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Method Summary
Modifier and TypeMethodDescriptionAdds the layout to the database.addLayout
(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, long classNameId, long classPK, Map<Locale, String> nameMap, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale, String> friendlyURLMap, long masterLayoutPlid, ServiceContext serviceContext) Adds a layout with additional parameters.addLayout
(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, boolean system, String friendlyURL, ServiceContext serviceContext) Adds a layout with single entry maps for name, title, and description to the default locale.addLayout
(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, String friendlyURL, ServiceContext serviceContext) Adds a layout with single entry maps for name, title, and description to the default locale.addLayout
(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale, String> friendlyURLMap, ServiceContext serviceContext) Adds a layout with additional parameters.addLayout
(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale, String> friendlyURLMap, ServiceContext serviceContext) Adds a layout with additional parameters.copyLayout
(long userId, long groupId, boolean privateLayout, Map<Locale, String> nameMap, boolean hidden, boolean system, boolean copyPermissions, long sourcePlid, ServiceContext serviceContext) copyLayoutContent
(long[] segmentsExperienceIds, Layout sourceLayout, Layout targetLayout) copyLayoutContent
(long segmentsExperienceId, Layout sourceLayout, Layout targetLayout) copyLayoutContent
(Layout sourceLayout, Layout targetLayout) createLayout
(long plid) Creates a new layout with the primary key.createPersistedModel
(Serializable primaryKeyObj) deleteLayout
(long plid) Deletes the layout with the primary key from the database.void
deleteLayout
(long groupId, boolean privateLayout, long layoutId, ServiceContext serviceContext) Deletes the layout with the layout ID, also deleting the layout's child layouts, and associated resources.void
deleteLayout
(long plid, ServiceContext serviceContext) Deletes the layout with the plid, also deleting the layout's child layouts, and associated resources.deleteLayout
(Layout layout) Deletes the layout from the database.void
deleteLayout
(Layout layout, ServiceContext serviceContext) Deletes the layout, its child layouts, and its associated resources.void
deleteLayout
(String externalReferenceCode, long groupId) void
deleteLayouts
(long groupId, boolean privateLayout, ServiceContext serviceContext) Deletes the group's private or non-private layouts, also deleting the layouts' child layouts, and associated resources.deletePersistedModel
(PersistedModel persistedModel) <T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) <T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.<T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.<T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.long
dynamicQueryCount
(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.fetchDefaultLayout
(long groupId, boolean privateLayout) fetchDraftLayout
(long plid) fetchFirstLayout
(long groupId, boolean privateLayout, long parentLayoutId) fetchFirstLayout
(long groupId, boolean privateLayout, long parentLayoutId, boolean hidden) fetchLayout
(long plid) fetchLayout
(long groupId, boolean privateLayout, long layoutId) fetchLayout
(long classNameId, long classPK) fetchLayout
(String uuid, long groupId, boolean privateLayout) fetchLayoutByExternalReferenceCode
(String externalReferenceCode, long groupId) fetchLayoutByFriendlyURL
(long groupId, boolean privateLayout, String friendlyURL) fetchLayoutByIconImageId
(boolean privateLayout, long iconImageId) fetchLayoutByUuidAndGroupId
(String uuid, long groupId, boolean privateLayout) Returns the layout matching the UUID, group, and privacy.getAllLayouts
(long groupId, boolean privateLayout, String type) Returns all the layouts that match the type and belong to the group, including the ones marked as System.getBrowsableLayout
(Layout layout) long
getDefaultPlid
(long groupId) Returns the primary key of the default layout for the group.long
getDefaultPlid
(long groupId, boolean privateLayout) Returns primary key of the matching default layout for the grouplong
getDefaultPlid
(long groupId, boolean privateLayout, String portletId) Returns primary key of the default portlet layout for the groupgetExportActionableDynamicQuery
(PortletDataContext portletDataContext) getFriendlyURLLayout
(long groupId, boolean privateLayout, String friendlyURL) Returns the layout for the friendly URL.getLayout
(long plid) Returns the layout with the primary key.getLayout
(long groupId, boolean privateLayout, long layoutId) Returns the layout matching the layout ID, group, and privacy; throws aNoSuchLayoutException
otherwise.getLayoutByExternalReferenceCode
(String externalReferenceCode, long groupId) getLayoutByFriendlyURL
(long groupId, boolean privateLayout, String friendlyURL) getLayoutByIconImageId
(long iconImageId) Returns the layout for the icon image; throws aNoSuchLayoutException
otherwise.getLayoutByUuidAndGroupId
(String uuid, long groupId, boolean privateLayout) Returns the layout matching the UUID, group, and privacy.getLayoutChildLayouts
(List<Layout> parentLayouts) getLayouts
(int start, int end) Returns a range of all the layouts.getLayouts
(long companyId) getLayouts
(long groupId, boolean privateLayout) Returns all the layouts belonging to the group.getLayouts
(long groupId, boolean privateLayout, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, boolean privateLayout, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, boolean privateLayout, long parentLayoutId) Returns all the layouts belonging to the group that are children of the parent layout.getLayouts
(long groupId, boolean privateLayout, long[] layoutIds) Returns all the layouts that match the layout IDs and belong to the group.getLayouts
(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end) Returns a range of all the layouts belonging to the group that are children of the parent layout.getLayouts
(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group that are children of the parent layout.getLayouts
(long groupId, boolean privateLayout, String type) Returns all the layouts that match the type and belong to the group.getLayouts
(long groupId, boolean privateLayout, String[] types) Returns all the layouts that match the type and belong to the group.getLayouts
(long groupId, boolean privateLayout, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) getLayouts
(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, String keywords, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long groupId, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.getLayouts
(long companyId, String portletId, String preferencesKey, String preferencesValue) Returns the layout references for all the layouts that belong to the company and belong to the portlet that matches the preferences.getLayouts
(Collection<Serializable> primaryKeys) getLayoutsByLayoutPrototypeUuid
(String layoutPrototypeUuid) int
getLayoutsByLayoutPrototypeUuidCount
(String layoutPrototypeUuid) getLayoutsByUuidAndCompanyId
(String uuid, long companyId) Returns all the layouts matching the UUID and company.getLayoutsByUuidAndCompanyId
(String uuid, long companyId, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of layouts matching the UUID and company.int
Returns the number of layouts.int
getLayoutsCount
(long groupId) int
getLayoutsCount
(long groupId, boolean privateLayout) int
getLayoutsCount
(long groupId, boolean privateLayout, long parentLayoutId) int
getLayoutsCount
(long groupId, long userId, boolean privateLayout, String keywords, String[] types) int
getLayoutsCount
(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int[] statuses) int
getLayoutsCount
(long groupId, String keywords, String[] types) int
getLayoutsCount
(long groupId, String keywords, String[] types, int[] statuses) int
getLayoutsCount
(Group group, boolean privateLayout) int
getLayoutsCount
(Group group, boolean privateLayout, boolean includeUserGroups) int
getLayoutsCount
(Group group, boolean privateLayout, long parentLayoutId) int
getLayoutsCount
(Group group, boolean privateLayout, long[] layoutIds) int
getLayoutsCount
(Group group, boolean privateLayout, String keywords, String[] types) int
getLayoutsCount
(User user, boolean privateLayout) int
getLayoutsCount
(User user, boolean privateLayout, boolean includeUserGroups) getMasterLayouts
(long groupId, long masterLayoutPlid) int
getMasterLayoutsCount
(long groupId, long masterLayoutPlid) long
getNextLayoutId
(long groupId, boolean privateLayout) Returns the layout ID to use for the next layout.Returns the OSGi service identifier.getParentLayout
(Layout layout) getPersistedModel
(Serializable primaryKeyObj) getPublishedLayouts
(long groupId, int start, int end, OrderByComparator<Layout> orderByComparator) int
getPublishedLayoutsCount
(long groupId) getScopeGroupLayouts
(long parentGroupId) getScopeGroupLayouts
(long parentGroupId, boolean privateLayout) Returns all the layouts within scope of the group.boolean
Returnstrue
if there is a matching layout with the UUID, group, and privacy.boolean
hasLayouts
(long groupId, boolean privateLayout, long parentLayoutId) Returnstrue
if the group has any layouts;false
otherwise.boolean
hasLayouts
(Group group) boolean
hasLayouts
(Group group, boolean privateLayout) boolean
hasLayouts
(Group group, boolean privateLayout, boolean includeUserGroups) boolean
hasLayouts
(User user, boolean privateLayout) boolean
hasLayouts
(User user, boolean privateLayout, boolean includeUserGroups) boolean
hasLayoutSetPrototypeLayout
(long layoutSetPrototypeId, String layoutUuid) boolean
hasLayoutSetPrototypeLayout
(String layoutSetPrototypeUuid, long companyId, String layoutUuid) search
(long groupId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) search
(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) search
(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) int
searchCount
(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types) int
searchCount
(Group group, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types) void
setLayouts
(long groupId, boolean privateLayout, long parentLayoutId, long[] layoutIds, ServiceContext serviceContext) Sets the layouts for the group, replacing and prioritizing all layouts of the parent layout.void
updateAsset
(long userId, Layout layout, long[] assetCategoryIds, String[] assetTagNames) updateFriendlyURL
(long userId, long plid, String friendlyURL, String languageId) Updates the friendly URL of the layout.updateIconImage
(long plid, byte[] bytes) updateLayout
(long groupId, boolean privateLayout, long layoutId, long classNameId, long classPK) Updates the layout replacing its entity class name ID and primary key.updateLayout
(long groupId, boolean privateLayout, long layoutId, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, String> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, boolean hidden, Map<Locale, String> friendlyURLMap, boolean hasIconImage, byte[] iconBytes, long styleBookEntryId, long faviconFileEntryId, long masterLayoutPlid, ServiceContext serviceContext) Updates the layout.updateLayout
(long groupId, boolean privateLayout, long layoutId, String typeSettings) Updates the layout replacing its type settings.updateLayout
(long groupId, boolean privateLayout, long layoutId, String typeSettings, byte[] iconBytes, String themeId, String colorSchemeId, long styleBookEntryId, String css, long faviconFileEntryId, long masterLayoutPlid) updateLayout
(long groupId, boolean privateLayout, long layoutId, Date publishDate) Updates the layout replacing its draft publish date.updateLayout
(Layout layout) Updates the layout in the database or adds it if it does not yet exist.updateLookAndFeel
(long groupId, boolean privateLayout, long layoutId, String themeId, String colorSchemeId, String css) Updates the look and feel of the layout.updateMasterLayoutPlid
(long groupId, boolean privateLayout, long layoutId, long masterLayoutPlid) Updates the layout replacing its master layout plid.updateName
(long groupId, boolean privateLayout, long layoutId, String name, String languageId) Updates the name of the layout matching the group, layout ID, and privacy.updateName
(long plid, String name, String languageId) Updates the name of the layout matching the primary key.updateName
(Layout layout, String name, String languageId) Updates the name of the layout.updateParentLayoutId
(long groupId, boolean privateLayout, long layoutId, long parentLayoutId) Updates the parent layout ID of the layout matching the group, layout ID, and privacy.updateParentLayoutId
(long plid, long parentPlid) Updates the parent layout ID of the layout matching the primary key.updateParentLayoutIdAndPriority
(long plid, long parentPlid, int priority) Updates the parent layout ID and priority of the layout.void
updatePriorities
(long groupId, boolean privateLayout) Updates the priorities of the layouts.updatePriority
(long groupId, boolean privateLayout, long layoutId, int priority) Updates the priority of the layout matching the group, layout ID, and privacy.updatePriority
(long groupId, boolean privateLayout, long layoutId, long nextLayoutId, long previousLayoutId) Updates the priority of the layout matching the group, layout ID, and privacy, setting the layout's priority based on the priorities of the next and previous layouts.updatePriority
(long plid, int priority) Updates the priority of the layout matching the primary key.updatePriority
(Layout layout, int priority) Updates the priority of the layout.updateStatus
(long userId, long plid, int status, ServiceContext serviceContext) updateStyleBookEntryId
(long groupId, boolean privateLayout, long layoutId, long styleBookEntryId) Updates the layout replacing its style book entry ID.updateType
(long plid, String type) <R,
E extends Throwable>
RupdateWithUnsafeFunction
(com.liferay.petra.function.UnsafeFunction<CTPersistence<Layout>, R, E> updateUnsafeFunction) Methods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel, getBasePersistence
-
Method Details
-
addLayout
Adds the layout to the database. Also notifies the appropriate model listeners.Important: Inspect LayoutLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
layout
- the layout- Returns:
- the layout that was added
-
addLayout
@Indexable(type=REINDEX) Layout addLayout(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, long classNameId, long classPK, Map<Locale, String> nameMap, Map<Locale, throws PortalExceptionString> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale, String> friendlyURLMap, long masterLayoutPlid, ServiceContext serviceContext) Adds a layout with additional parameters.This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.
- Parameters:
externalReferenceCode
- the layout's external reference codeuserId
- the primary key of the usergroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout (optionallyLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
)classNameId
- the class name ID of the entityclassPK
- the primary key of the entitynameMap
- the layout's locales and localized namestitleMap
- the layout's locales and localized titlesdescriptionMap
- the layout's locales and localized descriptionskeywordsMap
- the layout's locales and localized keywordsrobotsMap
- the layout's locales and localized robotstype
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.typeSettings
- the settings to load the unicode properties object. See#fastLoad(String)
.hidden
- whether the layout is hiddensystem
- whether the layout is of system typefriendlyURLMap
- the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.masterLayoutPlid
- the primary key of the master layoutserviceContext
- the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute namedlayoutUpdateable
can be set to specify whether site administrators can modify this page within their site. For layouts that are created from a layout prototype, attributes namedlayoutPrototypeUuid
andlayoutPrototypeLinkedEnabled
can be specified to provide the unique identifier of the source prototype and a boolean to determine whether a link to it should be enabled to activate propagation of changes made to the linked page in the prototype.- Returns:
- the layout
- Throws:
PortalException
- if a portal exception occurred
-
addLayout
@Indexable(type=REINDEX) Layout addLayout(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, throws PortalExceptionString> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, boolean system, Map<Locale, String> friendlyURLMap, ServiceContext serviceContext) Adds a layout with additional parameters.This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.
- Parameters:
externalReferenceCode
- the layout's external reference codeuserId
- the primary key of the usergroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout (optionallyLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
)nameMap
- the layout's locales and localized namestitleMap
- the layout's locales and localized titlesdescriptionMap
- the layout's locales and localized descriptionskeywordsMap
- the layout's locales and localized keywordsrobotsMap
- the layout's locales and localized robotstype
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.typeSettings
- the settings to load the unicode properties object. See#fastLoad(String)
.hidden
- whether the layout is hiddensystem
- whether the layout is of system typefriendlyURLMap
- the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.serviceContext
- the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute namedlayoutUpdateable
can be set to specify whether site administrators can modify this page within their site. For layouts that are created from a layout prototype, attributes namedlayoutPrototypeUuid
andlayoutPrototypeLinkedEnabled
can be specified to provide the unique identifier of the source prototype and a boolean to determine whether a link to it should be enabled to activate propagation of changes made to the linked page in the prototype.- Returns:
- the layout
- Throws:
PortalException
- if a portal exception occurred
-
addLayout
@Indexable(type=REINDEX) Layout addLayout(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, throws PortalExceptionString> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, String typeSettings, boolean hidden, Map<Locale, String> friendlyURLMap, ServiceContext serviceContext) Adds a layout with additional parameters.This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.
- Parameters:
externalReferenceCode
- the layout's external reference codeuserId
- the primary key of the usergroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout (optionallyLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
)nameMap
- the layout's locales and localized namestitleMap
- the layout's locales and localized titlesdescriptionMap
- the layout's locales and localized descriptionskeywordsMap
- the layout's locales and localized keywordsrobotsMap
- the layout's locales and localized robotstype
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.typeSettings
- the settings to load the unicode properties object. See#fastLoad(String)
.hidden
- whether the layout is hiddenfriendlyURLMap
- the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.serviceContext
- the service context to be applied. Must set the UUID for the layout. Can set the creation date, modification date, and expando bridge attributes for the layout. For layouts that belong to a layout set prototype, an attribute namedlayoutUpdateable
can be set to specify whether site administrators can modify this page within their site. For layouts that are created from a layout prototype, attributes namedlayoutPrototypeUuid
andlayoutPrototypeLinkedEnabled
can be specified to provide the unique identifier of the source prototype and a boolean to determine whether a link to it should be enabled to activate propagation of changes made to the linked page in the prototype.- Returns:
- the layout
- Throws:
PortalException
- if a portal exception occurred
-
addLayout
Layout addLayout(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, boolean system, String friendlyURL, ServiceContext serviceContext) throws PortalException Adds a layout with single entry maps for name, title, and description to the default locale.This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.
- Parameters:
externalReferenceCode
- the layout's external reference codeuserId
- the primary key of the usergroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout (optionallyLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
). The possible values can be found inLayoutConstants
.name
- the layout's name (optionallyPropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME
orPropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME
). The default values can be overridden inportal-ext.properties
by specifying new values for the corresponding properties defined inPropsValues
title
- the layout's titledescription
- the layout's descriptiontype
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.hidden
- whether the layout is hiddensystem
- whether the layout is of system typefriendlyURL
- the friendly URL of the layout (optionallyPropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL
orPropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL
). The default values can be overridden inportal-ext.properties
by specifying new values for the corresponding properties defined inPropsValues
. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.serviceContext
- the service context to be applied. Must set the UUID for the layout. Can set the creation date and modification date for the layout. For layouts that belong to a layout set prototype, an attribute namedlayoutUpdateable
can be set to specify whether site administrators can modify this page within their site.- Returns:
- the layout
- Throws:
PortalException
- if a portal exception occurred
-
addLayout
Layout addLayout(String externalReferenceCode, long userId, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, String friendlyURL, ServiceContext serviceContext) throws PortalException Adds a layout with single entry maps for name, title, and description to the default locale.This method handles the creation of the layout including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, ... etc.
- Parameters:
externalReferenceCode
- the layout's external reference codeuserId
- the primary key of the usergroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout (optionallyLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
). The possible values can be found inLayoutConstants
.name
- the layout's name (optionallyPropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME
orPropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME
). The default values can be overridden inportal-ext.properties
by specifying new values for the corresponding properties defined inPropsValues
title
- the layout's titledescription
- the layout's descriptiontype
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.hidden
- whether the layout is hiddenfriendlyURL
- the friendly URL of the layout (optionallyPropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL
orPropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL
). The default values can be overridden inportal-ext.properties
by specifying new values for the corresponding properties defined inPropsValues
. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.serviceContext
- the service context to be applied. Must set the UUID for the layout. Can set the creation date and modification date for the layout. For layouts that belong to a layout set prototype, an attribute namedlayoutUpdateable
can be set to specify whether site administrators can modify this page within their site.- Returns:
- the layout
- Throws:
PortalException
- if a portal exception occurred
-
copyLayout
Layout copyLayout(long userId, long groupId, boolean privateLayout, Map<Locale, String> nameMap, boolean hidden, boolean system, boolean copyPermissions, long sourcePlid, ServiceContext serviceContext) throws PortalException- Throws:
PortalException
-
copyLayoutContent
- Throws:
Exception
-
copyLayoutContent
Layout copyLayoutContent(long segmentsExperienceId, Layout sourceLayout, Layout targetLayout) throws Exception - Throws:
Exception
-
copyLayoutContent
Layout copyLayoutContent(long[] segmentsExperienceIds, Layout sourceLayout, Layout targetLayout) throws Exception - Throws:
Exception
-
createLayout
Creates a new layout with the primary key. Does not add the layout to the database.- Parameters:
plid
- the primary key for the new layout- Returns:
- the new layout
-
createPersistedModel
- Specified by:
createPersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
deleteLayout
Deletes the layout from the database. Also notifies the appropriate model listeners.Important: Inspect LayoutLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
layout
- the layout- Returns:
- the layout that was removed
- Throws:
PortalException
-
deleteLayout
@SystemEvent(action=1, type=1) void deleteLayout(Layout layout, ServiceContext serviceContext) throws PortalException Deletes the layout, its child layouts, and its associated resources.- Parameters:
layout
- the layoutserviceContext
- the service context to be applied- Throws:
PortalException
- if a portal exception occurred
-
deleteLayout
Deletes the layout with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect LayoutLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
plid
- the primary key of the layout- Returns:
- the layout that was removed
- Throws:
PortalException
- if a layout with the primary key could not be found
-
deleteLayout
void deleteLayout(long groupId, boolean privateLayout, long layoutId, ServiceContext serviceContext) throws PortalException Deletes the layout with the layout ID, also deleting the layout's child layouts, and associated resources.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutserviceContext
- the service context to be applied- Throws:
PortalException
- if a portal exception occurred
-
deleteLayout
Deletes the layout with the plid, also deleting the layout's child layouts, and associated resources.- Parameters:
plid
- the primary key of the layoutserviceContext
- the service context to be applied- Throws:
PortalException
- if a portal exception occurred
-
deleteLayout
- Throws:
PortalException
-
deleteLayouts
void deleteLayouts(long groupId, boolean privateLayout, ServiceContext serviceContext) throws PortalException Deletes the group's private or non-private layouts, also deleting the layouts' child layouts, and associated resources.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupserviceContext
- the service context to be applied. The parent layout set's page count will be updated by default, unless an attribute namedupdatePageCount
is set tofalse
.- Throws:
PortalException
- if a portal exception occurred
-
deletePersistedModel
- Specified by:
deletePersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
dslQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQuery
in interfacePersistedModelLocalService
-
dslQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCount
in interfacePersistedModelLocalService
-
dynamicQuery
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end) Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.LayoutModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.LayoutModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchDefaultLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchDefaultLayout(long groupId, boolean privateLayout) -
fetchDraftLayout
-
fetchFirstLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchFirstLayout(long groupId, boolean privateLayout, long parentLayoutId) -
fetchFirstLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchFirstLayout(long groupId, boolean privateLayout, long parentLayoutId, boolean hidden) -
fetchLayout
-
fetchLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(long groupId, boolean privateLayout, long layoutId) -
fetchLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(long classNameId, long classPK) -
fetchLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(String uuid, long groupId, boolean privateLayout) -
fetchLayoutByExternalReferenceCode
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByExternalReferenceCode(String externalReferenceCode, long groupId) -
fetchLayoutByFriendlyURL
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByFriendlyURL(long groupId, boolean privateLayout, String friendlyURL) -
fetchLayoutByIconImageId
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByIconImageId(boolean privateLayout, long iconImageId) throws PortalException - Throws:
PortalException
-
fetchLayoutByUuidAndGroupId
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout) Returns the layout matching the UUID, group, and privacy.- Parameters:
uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
- the matching layout, or
null
if a matching layout could not be found
-
getActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery() -
getAllLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getAllLayouts(long groupId, boolean privateLayout, String type) throws PortalException Returns all the layouts that match the type and belong to the group, including the ones marked as System.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouptype
- the type of the layouts (optiona.llyLayoutConstants#TYPE_PORTLET
)- Returns:
- the matching layouts, or an empty list if no matches were found
- Throws:
PortalException
-
getBrowsableLayout
-
getDefaultPlid
Returns the primary key of the default layout for the group.- Parameters:
groupId
- the primary key of the group- Returns:
- the primary key of the default layout for the group (optionally
LayoutConstants#DEFAULT_PLID
)
-
getDefaultPlid
@Transactional(propagation=SUPPORTS, readOnly=true) long getDefaultPlid(long groupId, boolean privateLayout) Returns primary key of the matching default layout for the group- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
- the primary key of the default layout for the group;
LayoutConstants#DEFAULT_PLID
) otherwise
-
getDefaultPlid
@Transactional(propagation=SUPPORTS, readOnly=true) long getDefaultPlid(long groupId, boolean privateLayout, String portletId) throws PortalException Returns primary key of the default portlet layout for the group- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupportletId
- the primary key of the portlet- Returns:
- the primary key of the default portlet layout for the group;
LayoutConstants#DEFAULT_PLID
otherwise - Throws:
PortalException
-
getExportActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getFriendlyURLLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getFriendlyURLLayout(long groupId, boolean privateLayout, String friendlyURL) throws PortalException Returns the layout for the friendly URL.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupfriendlyURL
- the friendly URL of the layout- Returns:
- the layout for the friendly URL
- Throws:
PortalException
- if a portal exception occurred
-
getIndexableActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayout(long plid) throws PortalException Returns the layout with the primary key.- Parameters:
plid
- the primary key of the layout- Returns:
- the layout
- Throws:
PortalException
- if a layout with the primary key could not be found
-
getLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayout(long groupId, boolean privateLayout, long layoutId) throws PortalException Returns the layout matching the layout ID, group, and privacy; throws aNoSuchLayoutException
otherwise.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layout- Returns:
- the matching layout
- Throws:
PortalException
- if a portal exception occurred
-
getLayoutByExternalReferenceCode
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByExternalReferenceCode(String externalReferenceCode, long groupId) throws PortalException - Throws:
PortalException
-
getLayoutByFriendlyURL
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByFriendlyURL(long groupId, boolean privateLayout, String friendlyURL) throws PortalException - Throws:
PortalException
-
getLayoutByIconImageId
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByIconImageId(long iconImageId) throws PortalException Returns the layout for the icon image; throws aNoSuchLayoutException
otherwise.- Parameters:
iconImageId
- the primary key of the icon image- Returns:
- Returns the layout for the icon image
- Throws:
PortalException
- if a portal exception occurred
-
getLayoutByUuidAndGroupId
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout) throws PortalException Returns the layout matching the UUID, group, and privacy.- Parameters:
uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
- the matching layout
- Throws:
PortalException
- if a matching layout could not be found
-
getLayoutChildLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) Map<Long,List<Layout>> getLayoutChildLayouts(List<Layout> parentLayouts) -
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(Collection<Serializable> primaryKeys) -
getLayouts
Returns a range of all the layouts.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.LayoutModelImpl
.- Parameters:
start
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)- Returns:
- the range of layouts
-
getLayouts
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout) Returns all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId) Returns all the layouts belonging to the group that are children of the parent layout.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end) Returns a range of all the layouts belonging to the group that are children of the parent layout.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layoutincomplete
- whether the layout is incompletestart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group that are children of the parent layout.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layoutstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long[] layoutIds) throws PortalException Returns all the layouts that match the layout IDs and belong to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutIds
- the layout IDs of the layouts- Returns:
- the matching layouts, or an empty list if no matches were found
- Throws:
PortalException
- if a portal exception occurred
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, String type) throws PortalException Returns all the layouts that match the type and belong to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouptype
- the type of the layouts (optionallyLayoutConstants#TYPE_PORTLET
)- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupkeywords
- keywordstypes
- layout typesstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, String[] types) throws PortalException Returns all the layouts that match the type and belong to the group.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouptypes
- the layout's type (optionallyLayoutConstants#TYPE_PORTLET
). The possible types can be found inLayoutConstants
.- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupuserId
- the primary key of the userprivateLayout
- whether the layout is private to the groupkeywords
- keywordstypes
- layout typesstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) LayoutReference[] getLayouts(long companyId, String portletId, String preferencesKey, String preferencesValue) Returns the layout references for all the layouts that belong to the company and belong to the portlet that matches the preferences.- Parameters:
companyId
- the primary key of the companyportletId
- the primary key of the portletpreferencesKey
- the portlet's preference keypreferencesValue
- the portlet's preference value- Returns:
- the layout references of the matching layouts
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, String keywords, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupkeywords
- keywordstypes
- layout typesstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, String keywords, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException Returns a range of all the layouts belonging to the group.- Parameters:
groupId
- the primary key of the groupkeywords
- keywordstypes
- layout typesstart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the layouts- Returns:
- the matching layouts, or
null
if no matches were found - Throws:
PortalException
-
getLayoutsByLayoutPrototypeUuid
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByLayoutPrototypeUuid(String layoutPrototypeUuid) -
getLayoutsByLayoutPrototypeUuidCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsByLayoutPrototypeUuidCount(String layoutPrototypeUuid) -
getLayoutsByUuidAndCompanyId
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByUuidAndCompanyId(String uuid, long companyId) Returns all the layouts matching the UUID and company.- Parameters:
uuid
- the UUID of the layoutscompanyId
- the primary key of the company- Returns:
- the matching layouts, or an empty list if no matches were found
-
getLayoutsByUuidAndCompanyId
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<Layout> orderByComparator) Returns a range of layouts matching the UUID and company.- Parameters:
uuid
- the UUID of the layoutscompanyId
- the primary key of the companystart
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)orderByComparator
- the comparator to order the results by (optionallynull
)- Returns:
- the range of matching layouts, or an empty list if no matches were found
-
getLayoutsCount
Returns the number of layouts.- Returns:
- the number of layouts
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, boolean includeUserGroups) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, long parentLayoutId) -
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, long[] layoutIds) -
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, String keywords, String[] types) throws PortalException - Throws:
PortalException
-
getLayoutsCount
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, boolean privateLayout) -
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, boolean privateLayout, long parentLayoutId) -
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, long userId, boolean privateLayout, String keywords, String[] types) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, long userId, boolean privateLayout, String keywords, String[] types, int[] statuses) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, String keywords, String[] types) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, String keywords, String[] types, int[] statuses) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(User user, boolean privateLayout) throws PortalException - Throws:
PortalException
-
getLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(User user, boolean privateLayout, boolean includeUserGroups) throws PortalException - Throws:
PortalException
-
getMasterLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getMasterLayouts(long groupId, long masterLayoutPlid) -
getMasterLayoutsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getMasterLayoutsCount(long groupId, long masterLayoutPlid) -
getNextLayoutId
@Transactional(propagation=SUPPORTS, readOnly=true) long getNextLayoutId(long groupId, boolean privateLayout) Returns the layout ID to use for the next layout.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
- the layout ID to use for the next layout
-
getOSGiServiceIdentifier
String getOSGiServiceIdentifier()Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getParentLayout
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getParentLayout(Layout layout) throws PortalException - Throws:
PortalException
-
getPersistedModel
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException - Specified by:
getPersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
getPublishedLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getPublishedLayouts(long groupId, int start, int end, OrderByComparator<Layout> orderByComparator) -
getPublishedLayoutsCount
-
getScopeGroupLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getScopeGroupLayouts(long parentGroupId) throws PortalException - Throws:
PortalException
-
getScopeGroupLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getScopeGroupLayouts(long parentGroupId, boolean privateLayout) throws PortalException Returns all the layouts within scope of the group.- Parameters:
parentGroupId
- the primary key of the group's parent groupprivateLayout
- whether the layout is private to the group- Returns:
- the layouts within scope of the group
- Throws:
PortalException
- if a portal exception occurred
-
hasLayout
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayout(String uuid, long groupId, boolean privateLayout) throws PortalException Returnstrue
if there is a matching layout with the UUID, group, and privacy.- Parameters:
uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Returns:
true
if the layout is found;false
otherwise- Throws:
PortalException
- if a portal exception occurred
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group) throws PortalException - Throws:
PortalException
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group, boolean privateLayout) throws PortalException - Throws:
PortalException
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group, boolean privateLayout, boolean includeUserGroups) throws PortalException - Throws:
PortalException
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(long groupId, boolean privateLayout, long parentLayoutId) Returnstrue
if the group has any layouts;false
otherwise.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layout- Returns:
true
if the group has any layouts;false
otherwise
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(User user, boolean privateLayout) throws PortalException - Throws:
PortalException
-
hasLayouts
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(User user, boolean privateLayout, boolean includeUserGroups) throws PortalException - Throws:
PortalException
-
hasLayoutSetPrototypeLayout
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayoutSetPrototypeLayout(long layoutSetPrototypeId, String layoutUuid) throws PortalException - Throws:
PortalException
-
hasLayoutSetPrototypeLayout
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayoutSetPrototypeLayout(String layoutSetPrototypeUuid, long companyId, String layoutUuid) throws PortalException - Throws:
PortalException
-
search
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> search(long groupId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException - Throws:
PortalException
-
search
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> search(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException - Throws:
PortalException
-
search
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> search(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types, int[] statuses, int start, int end, OrderByComparator<Layout> orderByComparator) throws PortalException - Throws:
PortalException
-
searchCount
@Transactional(propagation=SUPPORTS, readOnly=true) int searchCount(Group group, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types) throws PortalException - Throws:
PortalException
-
searchCount
@Transactional(propagation=SUPPORTS, readOnly=true) int searchCount(long groupId, long userId, boolean privateLayout, String keywords, boolean searchOnlyByTitle, String[] types) throws PortalException - Throws:
PortalException
-
setLayouts
void setLayouts(long groupId, boolean privateLayout, long parentLayoutId, long[] layoutIds, ServiceContext serviceContext) throws PortalException Sets the layouts for the group, replacing and prioritizing all layouts of the parent layout.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layoutlayoutIds
- the layout IDs of the layoutsserviceContext
- the service context to be applied- Throws:
PortalException
- if a portal exception occurred
-
updateAsset
void updateAsset(long userId, Layout layout, long[] assetCategoryIds, String[] assetTagNames) throws PortalException - Throws:
PortalException
-
updateFriendlyURL
Layout updateFriendlyURL(long userId, long plid, String friendlyURL, String languageId) throws PortalException Updates the friendly URL of the layout.- Parameters:
userId
- the primary key of the userplid
- the primary key of the layoutfriendlyURL
- the friendly URL to be assignedlanguageId
- the primary key of the language- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateIconImage
- Throws:
PortalException
-
updateLayout
Updates the layout in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect LayoutLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
layout
- the layout- Returns:
- the layout that was updated
-
updateLayout
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, Date publishDate) throws PortalException Updates the layout replacing its draft publish date.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutpublishDate
- the date when draft was last published- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateLayout
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, long classNameId, long classPK) throws PortalException Updates the layout replacing its entity class name ID and primary key.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutclassNameId
- the class name ID of the entityclassPK
- the primary key of the entity- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateLayout
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, long parentLayoutId, Map<Locale, String> nameMap, Map<Locale, throws PortalExceptionString> titleMap, Map<Locale, String> descriptionMap, Map<Locale, String> keywordsMap, Map<Locale, String> robotsMap, String type, boolean hidden, Map<Locale, String> friendlyURLMap, boolean hasIconImage, byte[] iconBytes, long styleBookEntryId, long faviconFileEntryId, long masterLayoutPlid, ServiceContext serviceContext) Updates the layout.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutparentLayoutId
- the layout ID of the layout's new parent layoutnameMap
- the locales and localized names to merge (optionallynull
)titleMap
- the locales and localized titles to merge (optionallynull
)descriptionMap
- the locales and localized descriptions to merge (optionallynull
)keywordsMap
- the locales and localized keywords to merge (optionallynull
)robotsMap
- the locales and localized robots to merge (optionallynull
)type
- the layout's new type (optionallyLayoutConstants#TYPE_PORTLET
)hidden
- whether the layout is hiddenfriendlyURLMap
- the layout's locales and localized friendly URLs. To see how the URL is normalized when accessed, seeFriendlyURLNormalizerUtil.normalize(String)
.hasIconImage
- whether the icon image will be updatediconBytes
- the byte array of the layout's new icon imagestyleBookEntryId
- the primary key of the style book entrysfaviconFileEntryId
- the file entry ID of the layout's new faviconmasterLayoutPlid
- the primary key of the master layoutserviceContext
- the service context to be applied. Can set the modification date and expando bridge attributes for the layout. For layouts that are linked to a layout prototype, attributes namedlayoutPrototypeUuid
andlayoutPrototypeLinkedEnabled
can be specified to provide the unique identifier of the source prototype and a boolean to determine whether a link to it should be enabled to activate propagation of changes made to the linked page in the prototype.- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateLayout
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, String typeSettings) throws PortalException Updates the layout replacing its type settings.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layouttypeSettings
- the settings to load the unicode properties object. See#fastLoad(String)
.- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateLayout
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, String typeSettings, byte[] iconBytes, String themeId, String colorSchemeId, long styleBookEntryId, String css, long faviconFileEntryId, long masterLayoutPlid) throws PortalException - Throws:
PortalException
-
updateLookAndFeel
Layout updateLookAndFeel(long groupId, boolean privateLayout, long layoutId, String themeId, String colorSchemeId, String css) throws PortalException Updates the look and feel of the layout.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutthemeId
- the primary key of the layout's new themecolorSchemeId
- the primary key of the layout's new color schemecss
- the layout's new CSS- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateMasterLayoutPlid
Layout updateMasterLayoutPlid(long groupId, boolean privateLayout, long layoutId, long masterLayoutPlid) throws PortalException Updates the layout replacing its master layout plid.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutmasterLayoutPlid
- the primary key of the master layout- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateName
Updates the name of the layout.- Parameters:
layout
- the layout to be updatedname
- the layout's new namelanguageId
- the primary key of the language. For more information seeLocale
.- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateName
Layout updateName(long groupId, boolean privateLayout, long layoutId, String name, String languageId) throws PortalException Updates the name of the layout matching the group, layout ID, and privacy.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutname
- the layout's new namelanguageId
- the primary key of the language. For more information seeLocale
.- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateName
Updates the name of the layout matching the primary key.- Parameters:
plid
- the primary key of the layoutname
- the name to be assignedlanguageId
- the primary key of the language. For more information seeLocale
.- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateParentLayoutId
Layout updateParentLayoutId(long groupId, boolean privateLayout, long layoutId, long parentLayoutId) throws PortalException Updates the parent layout ID of the layout matching the group, layout ID, and privacy.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutparentLayoutId
- the layout ID to be assigned to the parent layout- Returns:
- the matching layout
- Throws:
PortalException
- if a portal exception occurred
-
updateParentLayoutId
Updates the parent layout ID of the layout matching the primary key. If a layout matching the parent primary key is found, the layout ID of that layout is assigned, otherwiseLayoutConstants#DEFAULT_PARENT_LAYOUT_ID
is assigned.- Parameters:
plid
- the primary key of the layoutparentPlid
- the primary key of the parent layout- Returns:
- the layout matching the primary key
- Throws:
PortalException
- if a portal exception occurred
-
updateParentLayoutIdAndPriority
Layout updateParentLayoutIdAndPriority(long plid, long parentPlid, int priority) throws PortalException Updates the parent layout ID and priority of the layout.- Parameters:
plid
- the primary key of the layoutparentPlid
- the primary key of the parent layoutpriority
- the layout's new priority- Returns:
- the layout matching the primary key
- Throws:
PortalException
- if a portal exception occurred
-
updatePriorities
Updates the priorities of the layouts.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group- Throws:
PortalException
-
updatePriority
Updates the priority of the layout.- Parameters:
layout
- the layout to be updatedpriority
- the layout's new priority- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updatePriority
Layout updatePriority(long groupId, boolean privateLayout, long layoutId, int priority) throws PortalException Updates the priority of the layout matching the group, layout ID, and privacy.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutpriority
- the layout's new priority- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updatePriority
Layout updatePriority(long groupId, boolean privateLayout, long layoutId, long nextLayoutId, long previousLayoutId) throws PortalException Updates the priority of the layout matching the group, layout ID, and privacy, setting the layout's priority based on the priorities of the next and previous layouts.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutnextLayoutId
- the layout ID of the next layoutpreviousLayoutId
- the layout ID of the previous layout- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updatePriority
Updates the priority of the layout matching the primary key.- Parameters:
plid
- the primary key of the layoutpriority
- the layout's new priority- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateStatus
@Indexable(type=REINDEX) Layout updateStatus(long userId, long plid, int status, ServiceContext serviceContext) throws PortalException - Throws:
PortalException
-
updateStyleBookEntryId
Layout updateStyleBookEntryId(long groupId, boolean privateLayout, long layoutId, long styleBookEntryId) throws PortalException Updates the layout replacing its style book entry ID.- Parameters:
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutstyleBookEntryId
- the primary key of the style book entry- Returns:
- the updated layout
- Throws:
PortalException
- if a portal exception occurred
-
updateType
- Throws:
PortalException
-
getCTPersistence
- Specified by:
getCTPersistence
in interfaceCTService<Layout>
-
getModelClass
- Specified by:
getModelClass
in interfaceCTService<Layout>
-
updateWithUnsafeFunction
@Transactional(rollbackFor=java.lang.Throwable.class) <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Layout>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunction
in interfaceCTService<Layout>
- Throws:
E extends Throwable
-