@ProviderType @Transactional(isolation=PORTAL, rollbackFor={PortalException.class,SystemException.class}) public interface LayoutLocalService extends BaseLocalService, PersistedModelLocalService, VersionService<Layout,LayoutVersion>
LayoutLocalServiceUtil
Modifier and Type | Method and Description |
---|---|
Layout |
addLayout(Layout layout)
Adds the layout to the database.
|
Layout |
addLayout(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,
ServiceContext serviceContext)
Adds a layout with additional parameters.
|
Layout |
addLayout(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.
|
Layout |
addLayout(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.
|
Layout |
addLayout(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.
|
Layout |
addLayout(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.
|
void |
anonymizeLayout(Layout layout,
long userId,
User anonymousUser)
Anonymize user information of the specific layout
|
Layout |
checkout(Layout publishedLayout,
int version)
Checks out the previous version of the versioned model and saves it as a
draft.
|
Layout |
create()
Creates a new layout.
|
Layout |
delete(Layout publishedLayout)
Deletes the
VersionedModel . |
Layout |
deleteDraft(Layout draftLayout)
Deletes the
VersionedModel if it is a draft. |
Layout |
deleteLayout(Layout layout)
Deletes the layout from the database.
|
void |
deleteLayout(Layout layout,
boolean updateLayoutSet,
ServiceContext serviceContext)
Deletes the layout, its child layouts, and its associated resources.
|
Layout |
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.
|
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.
|
PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
LayoutVersion |
deleteVersion(LayoutVersion layoutVersion)
Deletes the
VersionModel if it is not the latest version. |
DynamicQuery |
dynamicQuery() |
<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.
|
Layout |
fetchDefaultLayout(long groupId,
boolean privateLayout) |
Layout |
fetchDraft(Layout layout)
Fetches the draft if it exists; otherwise, returns
null . |
Layout |
fetchDraft(long primaryKey)
Fetches the draft if it exists; otherwise, returns
null . |
Layout |
fetchFirstLayout(long groupId,
boolean privateLayout,
long parentLayoutId) |
Layout |
fetchFirstLayout(long groupId,
boolean privateLayout,
long parentLayoutId,
boolean hidden) |
LayoutVersion |
fetchLatestVersion(Layout layout)
Fetches the latest version model if it exists.
|
Layout |
fetchLayout(long plid) |
Layout |
fetchLayout(long groupId,
boolean privateLayout,
long layoutId) |
Layout |
fetchLayout(long classNameId,
long classPK) |
Layout |
fetchLayout(String uuid,
long groupId,
boolean privateLayout) |
Layout |
fetchLayoutByFriendlyURL(long groupId,
boolean privateLayout,
String friendlyURL) |
Layout |
fetchLayoutByIconImageId(boolean privateLayout,
long iconImageId) |
Layout |
fetchLayoutByUuidAndGroupId(String uuid,
long groupId,
boolean privateLayout)
Returns the layout matching the UUID, group, and privacy.
|
LayoutVersion |
fetchLayoutVersion(long layoutVersionId) |
Layout |
fetchPublished(Layout layout)
Fetches the published versioned model if it exists.
|
Layout |
fetchPublished(long primaryKey)
Fetches the published versioned model if it exists; otherwise, returns
null . |
ActionableDynamicQuery |
getActionableDynamicQuery() |
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 group
|
long |
getDefaultPlid(long groupId,
boolean privateLayout,
String portletId)
Returns primary key of the default portlet layout for the group
|
Layout |
getDraft(Layout layout)
Returns the versioned model draft.
|
Layout |
getDraft(long primaryKey)
Returns the versioned model draft with the primary key.
|
ExportActionableDynamicQuery |
getExportActionableDynamicQuery(PortletDataContext portletDataContext) |
Layout |
getFriendlyURLLayout(long groupId,
boolean privateLayout,
String friendlyURL)
Returns the layout for the friendly URL.
|
IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
Layout |
getLayout(long plid)
Returns the layout with the primary key.
|
Layout |
getLayout(long groupId,
boolean privateLayout,
long layoutId)
Returns the layout matching the layout ID, group, and privacy; throws a
NoSuchLayoutException otherwise. |
Layout |
getLayoutByIconImageId(long iconImageId)
Returns the layout for the icon image; throws a
NoSuchLayoutException otherwise. |
Layout |
getLayoutByUuidAndGroupId(String uuid,
long groupId,
boolean privateLayout)
Returns the layout matching the UUID, group, and privacy.
|
Map<Long,List<Layout>> |
getLayoutChildLayouts(LayoutSet layoutSet,
List<Layout> parentLayouts)
Deprecated.
As of Judson (7.1.x), replaced by
getLayoutChildLayouts(List) |
Map<Long,List<Layout>> |
getLayoutChildLayouts(List<Layout> parentLayouts) |
List<Layout> |
getLayouts(int start,
int end)
Returns a range of all the layouts.
|
List<Layout> |
getLayouts(long companyId) |
List<Layout> |
getLayouts(long groupId,
boolean privateLayout)
Returns all the layouts belonging to the group.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
int start,
int end,
OrderByComparator<Layout> obc)
Returns a range of all the layouts belonging to the group.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
long parentLayoutId)
Returns all the layouts belonging to the group that are children of the
parent layout.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
long[] layoutIds)
Returns all the layouts that match the layout IDs and belong to the
group.
|
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.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
long parentLayoutId,
boolean incomplete,
int start,
int end,
OrderByComparator<Layout> obc)
Returns a range of all the layouts belonging to the group that are
children of the parent layout.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
String type)
Returns all the layouts that match the type and belong to the group.
|
List<Layout> |
getLayouts(long groupId,
boolean privateLayout,
String keywords,
String[] types,
int start,
int end,
OrderByComparator<Layout> obc)
Returns a range of all the layouts belonging to the group.
|
List<Layout> |
getLayouts(long groupId,
int start,
int end,
OrderByComparator<Layout> obc)
Returns a range of all the layouts belonging to the group.
|
List<Layout> |
getLayouts(long groupId,
String keywords,
String[] types,
int start,
int end,
OrderByComparator<Layout> obc)
Returns a range of all the layouts belonging to the group.
|
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.
|
List<Layout> |
getLayoutsByLayoutPrototypeUuid(String layoutPrototypeUuid) |
int |
getLayoutsByLayoutPrototypeUuidCount(String layoutPrototypeUuid) |
List<Layout> |
getLayoutsByUuidAndCompanyId(String uuid,
long companyId)
Returns all the layouts matching the UUID and company.
|
List<Layout> |
getLayoutsByUuidAndCompanyId(String uuid,
long companyId,
int start,
int end,
OrderByComparator<Layout> orderByComparator)
Returns a range of layouts matching the UUID and company.
|
int |
getLayoutsCount()
Returns the number of layouts.
|
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(long groupId) |
int |
getLayoutsCount(long groupId,
String keywords,
String[] types) |
int |
getLayoutsCount(User user,
boolean privateLayout) |
int |
getLayoutsCount(User user,
boolean privateLayout,
boolean includeUserGroups) |
long |
getNextLayoutId(long groupId,
boolean privateLayout)
Returns the layout ID to use for the next layout.
|
List<Layout> |
getNoPermissionLayouts(long roleId)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
List<Layout> |
getNullFriendlyURLLayouts()
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
Layout |
getParentLayout(Layout layout) |
PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
List<Layout> |
getScopeGroupLayouts(long parentGroupId) |
List<Layout> |
getScopeGroupLayouts(long parentGroupId,
boolean privateLayout)
Returns all the layouts within scope of the group.
|
LayoutVersion |
getVersion(Layout layout,
int version)
Returns the
VersionModel for the VersionedModel matching
the version. |
List<LayoutVersion> |
getVersions(Layout layout)
Returns the
VersionModel s for the VersionedModel . |
boolean |
hasLayout(String uuid,
long groupId,
boolean privateLayout)
Returns
true if there is a matching layout with the UUID,
group, and privacy. |
boolean |
hasLayouts(Group group) |
boolean |
hasLayouts(Group group,
boolean privateLayout) |
boolean |
hasLayouts(Group group,
boolean privateLayout,
boolean includeUserGroups) |
boolean |
hasLayouts(long groupId,
boolean privateLayout,
long parentLayoutId)
Returns
true if the group has any layouts;
false otherwise. |
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) |
Layout |
publishDraft(Layout draftLayout)
Publishes the draft and creates a new version model for the new version.
|
void |
registerListener(VersionServiceListener<Layout,LayoutVersion> versionServiceListener)
Registers the
VersionServiceListener . |
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 |
unregisterListener(VersionServiceListener<Layout,LayoutVersion> versionServiceListener)
Unregisters the
VersionServiceListener . |
void |
updateAsset(long userId,
Layout layout,
long[] assetCategoryIds,
String[] assetTagNames) |
Layout |
updateDraft(Layout draftLayout)
Updates the draft.
|
Layout |
updateFriendlyURL(long userId,
long plid,
String friendlyURL,
String languageId)
Updates the friendly URL of the layout.
|
Layout |
updateIconImage(long plid,
byte[] bytes) |
Layout |
updateLayout(Layout draftLayout)
Updates the layout in the database or adds it if it does not yet exist.
|
Layout |
updateLayout(long groupId,
boolean privateLayout,
long layoutId,
Date publishDate)
Updates the layout replacing its draft publish date.
|
Layout |
updateLayout(long groupId,
boolean privateLayout,
long layoutId,
long classNameId,
long classPK)
Updates the layout replacing its entity class name ID and primary key.
|
Layout |
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,
ServiceContext serviceContext)
Updates the layout.
|
Layout |
updateLayout(long groupId,
boolean privateLayout,
long layoutId,
String typeSettings)
Updates the layout replacing its type settings.
|
Layout |
updateLookAndFeel(long groupId,
boolean privateLayout,
long layoutId,
String themeId,
String colorSchemeId,
String css)
Updates the look and feel of the layout.
|
Layout |
updateName(Layout layout,
String name,
String languageId)
Updates the name of the layout.
|
Layout |
updateName(long groupId,
boolean privateLayout,
long layoutId,
String name,
String languageId)
Updates the name of the layout matching the group, layout ID, and
privacy.
|
Layout |
updateName(long plid,
String name,
String languageId)
Updates the name of the layout matching the primary key.
|
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.
|
Layout |
updateParentLayoutId(long plid,
long parentPlid)
Updates the parent layout ID of the layout matching the primary key.
|
Layout |
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.
|
Layout |
updatePriority(Layout layout,
int priority)
Updates the priority of the layout.
|
Layout |
updatePriority(long groupId,
boolean privateLayout,
long layoutId,
int priority)
Updates the priority of the layout matching the group, layout ID, and
privacy.
|
Layout |
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.
|
Layout |
updatePriority(long plid,
int priority)
Updates the priority of the layout matching the primary key.
|
Layout |
updateType(long plid,
String type) |
@Indexable(type=REINDEX) Layout addLayout(Layout layout)
layout
- the layout@Indexable(type=REINDEX) Layout addLayout(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, ServiceContext serviceContext) throws PortalException
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.
userId
- 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 (optionally
LayoutConstants#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 (optionally LayoutConstants#TYPE_PORTLET
). The possible types can be found
in LayoutConstants
.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, see FriendlyURLNormalizerUtil.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 named
layoutUpdateable
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
named layoutPrototypeUuid
and
layoutPrototypeLinkedEnabled
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.PortalException
- if a portal exception occurred@Indexable(type=REINDEX) Layout addLayout(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) throws PortalException
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.
userId
- 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 (optionally
LayoutConstants#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 (optionally LayoutConstants#TYPE_PORTLET
). The possible types can be found
in LayoutConstants
.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, see FriendlyURLNormalizerUtil.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 named
layoutUpdateable
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
named layoutPrototypeUuid
and
layoutPrototypeLinkedEnabled
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.PortalException
- if a portal exception occurred@Indexable(type=REINDEX) Layout addLayout(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) throws PortalException
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.
userId
- 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 (optionally
LayoutConstants#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 (optionally LayoutConstants#TYPE_PORTLET
). The possible types can be found
in LayoutConstants
.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, see FriendlyURLNormalizerUtil.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 named
layoutUpdateable
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
named layoutPrototypeUuid
and
layoutPrototypeLinkedEnabled
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.PortalException
- if a portal exception occurredLayout addLayout(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
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.
userId
- 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 (optionally
LayoutConstants#DEFAULT_PARENT_LAYOUT_ID
). The possible
values can be found in LayoutConstants
.name
- the layout's name (optionally PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME
or PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME
). The default values
can be overridden in portal-ext.properties
by
specifying new values for the corresponding properties defined in
PropsValues
title
- the layout's titledescription
- the layout's descriptiontype
- the layout's type (optionally LayoutConstants#TYPE_PORTLET
). The possible types can be found
in LayoutConstants
.hidden
- whether the layout is hiddensystem
- whether the layout is of system typefriendlyURL
- the friendly URL of the layout (optionally PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL
or PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL
). The
default values can be overridden in
portal-ext.properties
by specifying new values for
the corresponding properties defined in PropsValues
. To
see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.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 named layoutUpdateable
can
be set to specify whether site administrators can modify this
page within their site.PortalException
- if a portal exception occurredLayout addLayout(long userId, long groupId, boolean privateLayout, long parentLayoutId, String name, String title, String description, String type, boolean hidden, String friendlyURL, ServiceContext serviceContext) throws PortalException
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.
userId
- 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 (optionally
LayoutConstants#DEFAULT_PARENT_LAYOUT_ID
). The possible
values can be found in LayoutConstants
.name
- the layout's name (optionally PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_NAME
or PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_NAME
). The default values
can be overridden in portal-ext.properties
by
specifying new values for the corresponding properties defined in
PropsValues
title
- the layout's titledescription
- the layout's descriptiontype
- the layout's type (optionally LayoutConstants#TYPE_PORTLET
). The possible types can be found
in LayoutConstants
.hidden
- whether the layout is hiddenfriendlyURL
- the friendly URL of the layout (optionally PropsValues#DEFAULT_USER_PRIVATE_LAYOUT_FRIENDLY_URL
or PropsValues#DEFAULT_USER_PUBLIC_LAYOUT_FRIENDLY_URL
). The
default values can be overridden in
portal-ext.properties
by specifying new values for
the corresponding properties defined in PropsValues
. To
see how the URL is normalized when accessed, see FriendlyURLNormalizerUtil.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 named layoutUpdateable
can
be set to specify whether site administrators can modify this
page within their site.PortalException
- if a portal exception occurredvoid anonymizeLayout(Layout layout, long userId, User anonymousUser) throws PortalException
layout
- the layout that need to anonymizeduserId
- the primary key of the owner useranonymousUser
- the anonymized user informationPortalException
@Indexable(type=REINDEX) Layout checkout(Layout publishedLayout, int version) throws PortalException
VersionService
VersionServiceListener
that has been registered is
also notified. An IllegalArgumentException
is thrown if the
versioned model already has a draft.checkout
in interface VersionService<Layout,LayoutVersion>
publishedLayout
- the published versioned modelversion
- the versionVersionModel
being checked outPortalException
- if the version does not exist@Transactional(enabled=false) Layout create()
create
in interface VersionService<Layout,LayoutVersion>
@Indexable(type=DELETE) Layout delete(Layout publishedLayout) throws PortalException
VersionService
VersionedModel
. Related drafts and versions are also
deleted. Any VersionServiceListener
that has been registered is
notified. An IllegalArgumentException
is thrown if the versioned
model is a draft. Drafts can be deleted by calling VersionService.deleteDraft(VersionedModel)
.delete
in interface VersionService<Layout,LayoutVersion>
publishedLayout
- the published versioned modelPortalException
- if a portal exception occurred@Indexable(type=DELETE) Layout deleteDraft(Layout draftLayout) throws PortalException
VersionService
VersionedModel
if it is a draft. Any VersionServiceListener
that has been registered is notified. An IllegalArgumentException
is thrown if the versioned model is not a
draft. Published versioned models can be deleted by calling VersionService.delete(VersionedModel)
.deleteDraft
in interface VersionService<Layout,LayoutVersion>
draftLayout
- the draft versioned modelPortalException
- if a portal exception occurred@Indexable(type=DELETE) Layout deleteLayout(Layout layout) throws PortalException
layout
- the layoutPortalException
@SystemEvent(action=1, type=1) void deleteLayout(Layout layout, boolean updateLayoutSet, ServiceContext serviceContext) throws PortalException
layout
- the layoutupdateLayoutSet
- whether the layout set's page counter needs to be
updatedserviceContext
- the service context to be appliedPortalException
- if a portal exception occurred@Indexable(type=DELETE) Layout deleteLayout(long plid) throws PortalException
plid
- the primary key of the layoutPortalException
- if a layout with the primary key could not be foundvoid deleteLayout(long groupId, boolean privateLayout, long layoutId, ServiceContext serviceContext) throws PortalException
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 appliedPortalException
- if a portal exception occurredvoid deleteLayout(long plid, ServiceContext serviceContext) throws PortalException
plid
- the primary key of the layoutserviceContext
- the service context to be appliedPortalException
- if a portal exception occurredvoid deleteLayouts(long groupId, boolean privateLayout, ServiceContext serviceContext) throws PortalException
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 named updatePageCount
is set to
false
.PortalException
- if a portal exception occurredPersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
deletePersistedModel
in interface PersistedModelLocalService
PortalException
LayoutVersion deleteVersion(LayoutVersion layoutVersion) throws PortalException
VersionService
VersionModel
if it is not the latest version. Any
VersionServiceListener
that has been registered is notified. An
IllegalArgumentException
is thrown if the versioned model is the
latest version.deleteVersion
in interface VersionService<Layout,LayoutVersion>
layoutVersion
- the version modelPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) DynamicQuery dynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.LayoutModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.LayoutModelImpl
.
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 (optionally null
)@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic query@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchDefaultLayout(long groupId, boolean privateLayout)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchDraft(Layout layout)
VersionService
null
.fetchDraft
in interface VersionService<Layout,LayoutVersion>
layout
- the draft or published versioned modelnull
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchDraft(long primaryKey)
VersionService
null
.fetchDraft
in interface VersionService<Layout,LayoutVersion>
primaryKey
- the draft or published versioned model's primary keynull
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchFirstLayout(long groupId, boolean privateLayout, long parentLayoutId)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchFirstLayout(long groupId, boolean privateLayout, long parentLayoutId, boolean hidden)
@Transactional(propagation=SUPPORTS, readOnly=true) LayoutVersion fetchLatestVersion(Layout layout)
VersionService
null
is returned.fetchLatestVersion
in interface VersionService<Layout,LayoutVersion>
layout
- the versioned modelnull
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(long plid)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(long groupId, boolean privateLayout, long layoutId)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(long classNameId, long classPK)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayout(String uuid, long groupId, boolean privateLayout)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByFriendlyURL(long groupId, boolean privateLayout, String friendlyURL)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByIconImageId(boolean privateLayout, long iconImageId) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout)
uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupnull
if a matching layout
could not be found@Transactional(propagation=SUPPORTS, readOnly=true) LayoutVersion fetchLayoutVersion(long layoutVersionId)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchPublished(Layout layout)
VersionService
null
is returned.fetchPublished
in interface VersionService<Layout,LayoutVersion>
layout
- the versioned modelnull
@Transactional(propagation=SUPPORTS, readOnly=true) Layout fetchPublished(long primaryKey)
VersionService
null
.fetchPublished
in interface VersionService<Layout,LayoutVersion>
primaryKey
- the published versioned model's primary keynull
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) long getDefaultPlid(long groupId)
groupId
- the primary key of the groupLayoutConstants#DEFAULT_PLID
)@Transactional(propagation=SUPPORTS, readOnly=true) long getDefaultPlid(long groupId, boolean privateLayout)
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupLayoutConstants#DEFAULT_PLID
) otherwise@Transactional(propagation=SUPPORTS, readOnly=true) long getDefaultPlid(long groupId, boolean privateLayout, String portletId) throws PortalException
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupportletId
- the primary key of the portletLayoutConstants#DEFAULT_PLID
otherwisePortalException
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getDraft(Layout layout) throws PortalException
VersionService
VersionServiceListener
that has been registered is notified.getDraft
in interface VersionService<Layout,LayoutVersion>
layout
- the versioned modelPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) Layout getDraft(long primaryKey) throws PortalException
VersionService
VersionServiceListener
that has been
registered is notified.getDraft
in interface VersionService<Layout,LayoutVersion>
primaryKey
- of the draft or published versioned modelPortalException
- if no draft or published versioned model exists
with the primary key@Transactional(propagation=SUPPORTS, readOnly=true) ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getFriendlyURLLayout(long groupId, boolean privateLayout, String friendlyURL) throws PortalException
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupfriendlyURL
- the friendly URL of the layoutPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayout(long plid) throws PortalException
plid
- the primary key of the layoutPortalException
- if a layout with the primary key could not be found@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayout(long groupId, boolean privateLayout, long layoutId) throws PortalException
NoSuchLayoutException
otherwise.groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutId
- the layout ID of the layoutPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByIconImageId(long iconImageId) throws PortalException
NoSuchLayoutException
otherwise.iconImageId
- the primary key of the icon imagePortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) Layout getLayoutByUuidAndGroupId(String uuid, long groupId, boolean privateLayout) throws PortalException
uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupPortalException
- if a matching layout could not be found@Deprecated @Transactional(propagation=SUPPORTS, readOnly=true) Map<Long,List<Layout>> getLayoutChildLayouts(LayoutSet layoutSet, List<Layout> parentLayouts)
getLayoutChildLayouts(List)
@Transactional(propagation=SUPPORTS, readOnly=true) Map<Long,List<Layout>> getLayoutChildLayouts(List<Layout> parentLayouts)
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.LayoutModelImpl
.
start
- the lower bound of the range of layoutsend
- the upper bound of the range of layouts (not inclusive)@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long companyId)
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout)
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupnull
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, int start, int end, OrderByComparator<Layout> obc)
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)obc
- the comparator to order the layoutsnull
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId)
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layoutnull
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full
result set.
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)null
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long parentLayoutId, boolean incomplete, int start, int end, OrderByComparator<Layout> obc)
Useful when paginating results. Returns a maximum of end -
start
instances. start
and end
are not
primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full
result set.
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)obc
- the comparator to order the layoutsnull
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, long[] layoutIds) throws PortalException
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouplayoutIds
- the layout IDs of the layoutsPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, String type) throws PortalException
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouptype
- the type of the layouts (optionally LayoutConstants#TYPE_PORTLET
)null
if no matches were
foundPortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, boolean privateLayout, String keywords, String[] types, int start, int end, OrderByComparator<Layout> obc) throws PortalException
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)obc
- the comparator to order the layoutsnull
if no matches were
foundPortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, int start, int end, OrderByComparator<Layout> obc)
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)obc
- the comparator to order the layoutsnull
if no matches were
found@Transactional(propagation=SUPPORTS, readOnly=true) LayoutReference[] getLayouts(long companyId, String portletId, String preferencesKey, String preferencesValue)
companyId
- the primary key of the companyportletId
- the primary key of the portletpreferencesKey
- the portlet's preference keypreferencesValue
- the portlet's preference value@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayouts(long groupId, String keywords, String[] types, int start, int end, OrderByComparator<Layout> obc) throws PortalException
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)obc
- the comparator to order the layoutsnull
if no matches were
foundPortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByLayoutPrototypeUuid(String layoutPrototypeUuid)
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsByLayoutPrototypeUuidCount(String layoutPrototypeUuid)
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByUuidAndCompanyId(String uuid, long companyId)
uuid
- the UUID of the layoutscompanyId
- the primary key of the company@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getLayoutsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<Layout> orderByComparator)
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
(optionally null
)@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount()
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, boolean includeUserGroups) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, long parentLayoutId)
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, long[] layoutIds)
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(Group group, boolean privateLayout, String keywords, String[] types) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId)
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(long groupId, String keywords, String[] types) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(User user, boolean privateLayout) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) int getLayoutsCount(User user, boolean privateLayout, boolean includeUserGroups) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) long getNextLayoutId(long groupId, boolean privateLayout)
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the group@Deprecated @Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getNoPermissionLayouts(long roleId)
roleId
- the primary key of the role@Deprecated @Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getNullFriendlyURLLayouts()
null
null
String getOSGiServiceIdentifier()
@Transactional(propagation=SUPPORTS, readOnly=true) Layout getParentLayout(Layout layout) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
getPersistedModel
in interface PersistedModelLocalService
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getScopeGroupLayouts(long parentGroupId) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) List<Layout> getScopeGroupLayouts(long parentGroupId, boolean privateLayout) throws PortalException
parentGroupId
- the primary key of the group's parent groupprivateLayout
- whether the layout is private to the groupPortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) LayoutVersion getVersion(Layout layout, int version) throws PortalException
VersionService
VersionModel
for the VersionedModel
matching
the version.getVersion
in interface VersionService<Layout,LayoutVersion>
layout
- the versioned modelversion
- the versionPortalException
- if the version does not exist@Transactional(propagation=SUPPORTS, readOnly=true) List<LayoutVersion> getVersions(Layout layout)
VersionService
VersionModel
s for the VersionedModel
. They
are sorted in descending order.getVersions
in interface VersionService<Layout,LayoutVersion>
layout
- the versioned model@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayout(String uuid, long groupId, boolean privateLayout) throws PortalException
true
if there is a matching layout with the UUID,
group, and privacy.uuid
- the layout's UUIDgroupId
- the primary key of the groupprivateLayout
- whether the layout is private to the grouptrue
if the layout is found; false
otherwisePortalException
- if a portal exception occurred@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group, boolean privateLayout) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(Group group, boolean privateLayout, boolean includeUserGroups) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(long groupId, boolean privateLayout, long parentLayoutId)
true
if the group has any layouts;
false
otherwise.groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupparentLayoutId
- the layout ID of the parent layouttrue
if the group has any layouts;
false
otherwise@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(User user, boolean privateLayout) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayouts(User user, boolean privateLayout, boolean includeUserGroups) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayoutSetPrototypeLayout(long layoutSetPrototypeId, String layoutUuid) throws PortalException
PortalException
@Transactional(propagation=SUPPORTS, readOnly=true) boolean hasLayoutSetPrototypeLayout(String layoutSetPrototypeUuid, long companyId, String layoutUuid) throws PortalException
PortalException
@Indexable(type=REINDEX) Layout publishDraft(Layout draftLayout) throws PortalException
VersionService
VersionServiceListener
that has been registered is notified.
An IllegalArgumentException
is thrown if the versioned model is
not a draft.publishDraft
in interface VersionService<Layout,LayoutVersion>
draftLayout
- the draft version modelPortalException
- if a portal exception occurredvoid registerListener(VersionServiceListener<Layout,LayoutVersion> versionServiceListener)
VersionService
VersionServiceListener
.registerListener
in interface VersionService<Layout,LayoutVersion>
versionServiceListener
- the version service listener to registervoid setLayouts(long groupId, boolean privateLayout, long parentLayoutId, long[] layoutIds, ServiceContext serviceContext) throws PortalException
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 appliedPortalException
- if a portal exception occurredvoid unregisterListener(VersionServiceListener<Layout,LayoutVersion> versionServiceListener)
VersionService
VersionServiceListener
.unregisterListener
in interface VersionService<Layout,LayoutVersion>
versionServiceListener
- the version service listener to unregistervoid updateAsset(long userId, Layout layout, long[] assetCategoryIds, String[] assetTagNames) throws PortalException
PortalException
@Indexable(type=REINDEX) Layout updateDraft(Layout draftLayout) throws PortalException
VersionService
VersionServiceListener
that has been
registered is notified. An IllegalArgumentException
is thrown if
the versioned model is not a draft.updateDraft
in interface VersionService<Layout,LayoutVersion>
draftLayout
- the draft version modelPortalException
- if a portal exception occurredLayout updateFriendlyURL(long userId, long plid, String friendlyURL, String languageId) throws PortalException
userId
- the primary key of the userplid
- the primary key of the layoutfriendlyURL
- the friendly URL to be assignedlanguageId
- the primary key of the languagePortalException
- if a portal exception occurredLayout updateIconImage(long plid, byte[] bytes) throws PortalException
PortalException
@Indexable(type=REINDEX) Layout updateLayout(Layout draftLayout) throws PortalException
layout
- the layoutPortalException
Layout updateLayout(long groupId, boolean privateLayout, long layoutId, Date publishDate) throws PortalException
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 publishedPortalException
- if a portal exception occurredLayout updateLayout(long groupId, boolean privateLayout, long layoutId, long classNameId, long classPK) throws PortalException
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 entityPortalException
- if a portal exception occurredLayout 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, ServiceContext serviceContext) throws PortalException
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 (optionally
null
)titleMap
- the locales and localized titles to merge (optionally
null
)descriptionMap
- the locales and localized descriptions to merge
(optionally null
)keywordsMap
- the locales and localized keywords to merge
(optionally null
)robotsMap
- the locales and localized robots to merge (optionally
null
)type
- the layout's new type (optionally LayoutConstants#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, see FriendlyURLNormalizerUtil.normalize(
String)
.hasIconImage
- whether the icon image will be updatediconBytes
- the byte array of the layout's new icon imageserviceContext
- 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
named layoutPrototypeUuid
and
layoutPrototypeLinkedEnabled
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.PortalException
- if a portal exception occurredLayout updateLayout(long groupId, boolean privateLayout, long layoutId, String typeSettings) throws PortalException
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)
.PortalException
- if a portal exception occurredLayout updateLookAndFeel(long groupId, boolean privateLayout, long layoutId, String themeId, String colorSchemeId, String css) throws PortalException
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 CSSPortalException
- if a portal exception occurredLayout updateName(Layout layout, String name, String languageId) throws PortalException
layout
- the layout to be updatedname
- the layout's new namelanguageId
- the primary key of the language. For more information
see Locale
.PortalException
- if a portal exception occurredLayout updateName(long groupId, boolean privateLayout, long layoutId, String name, String languageId) throws PortalException
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
see Locale
.PortalException
- if a portal exception occurredLayout updateName(long plid, String name, String languageId) throws PortalException
plid
- the primary key of the layoutname
- the name to be assignedlanguageId
- the primary key of the language. For more information
see Locale
.PortalException
- if a portal exception occurredLayout updateParentLayoutId(long groupId, boolean privateLayout, long layoutId, long parentLayoutId) throws PortalException
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 layoutPortalException
- if a portal exception occurredLayout updateParentLayoutId(long plid, long parentPlid) throws PortalException
LayoutConstants#DEFAULT_PARENT_LAYOUT_ID
is assigned.plid
- the primary key of the layoutparentPlid
- the primary key of the parent layoutPortalException
- if a portal exception occurredLayout updateParentLayoutIdAndPriority(long plid, long parentPlid, int priority) throws PortalException
plid
- the primary key of the layoutparentPlid
- the primary key of the parent layoutpriority
- the layout's new priorityPortalException
- if a portal exception occurredvoid updatePriorities(long groupId, boolean privateLayout) throws PortalException
groupId
- the primary key of the groupprivateLayout
- whether the layout is private to the groupPortalException
Layout updatePriority(Layout layout, int priority) throws PortalException
layout
- the layout to be updatedpriority
- the layout's new priorityPortalException
- if a portal exception occurredLayout updatePriority(long groupId, boolean privateLayout, long layoutId, int priority) throws PortalException
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 priorityPortalException
- if a portal exception occurredLayout updatePriority(long groupId, boolean privateLayout, long layoutId, long nextLayoutId, long previousLayoutId) throws PortalException
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 layoutPortalException
- if a portal exception occurredLayout updatePriority(long plid, int priority) throws PortalException
plid
- the primary key of the layoutpriority
- the layout's new priorityPortalException
- if a portal exception occurredLayout updateType(long plid, String type) throws PortalException
PortalException