public class LayoutImpl extends LayoutBaseImpl
The UI name for a layout is "page." Thus, a layout represents a page in the
portal. A single page is either part of the public or private layout set of a
group (site). Layouts can be organized hierarchically and are summarized in a
LayoutSet
.
COLUMN_BITMASK_ENABLED, COMPANYID_COLUMN_BITMASK, DATA_SOURCE, ENTITY_CACHE_ENABLED, FINDER_CACHE_ENABLED, FRIENDLYURL_COLUMN_BITMASK, GROUPID_COLUMN_BITMASK, ICONIMAGEID_COLUMN_BITMASK, LAYOUTID_COLUMN_BITMASK, LAYOUTPROTOTYPEUUID_COLUMN_BITMASK, LOCK_EXPIRATION_TIME, ORDER_BY_JPQL, ORDER_BY_SQL, PARENTLAYOUTID_COLUMN_BITMASK, PRIORITY_COLUMN_BITMASK, PRIVATELAYOUT_COLUMN_BITMASK, SESSION_FACTORY, SOURCEPROTOTYPELAYOUTUUID_COLUMN_BITMASK, TABLE_COLUMNS, TABLE_COLUMNS_MAP, TABLE_NAME, TABLE_SQL_CREATE, TABLE_SQL_DROP, TX_MANAGER, TYPE_COLUMN_BITMASK, UUID_COLUMN_BITMASK
Constructor and Description |
---|
LayoutImpl() |
Modifier and Type | Method and Description |
---|---|
List<com.liferay.portal.kernel.model.Layout> |
getAllChildren()
Returns all layouts that are direct or indirect children of the current
layout.
|
long |
getAncestorLayoutId()
Returns the ID of the topmost parent layout (e.g. n-th parent layout) of
the current layout.
|
long |
getAncestorPlid()
Returns the plid of the topmost parent layout (e.g. n-th parent layout)
of the current layout.
|
List<com.liferay.portal.kernel.model.Layout> |
getAncestors()
Returns all parent layouts of the current layout.
|
List<com.liferay.portal.kernel.model.Layout> |
getChildren()
Returns all child layouts of the current layout, independent of user
access permissions.
|
List<com.liferay.portal.kernel.model.Layout> |
getChildren(com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker)
Returns all child layouts of the current layout that the user has
permission to access.
|
com.liferay.portal.kernel.model.ColorScheme |
getColorScheme()
Returns the color scheme that is configured for the current layout, or
the color scheme of the layout set that contains the current layout if no
color scheme is configured.
|
String |
getCssText()
Returns the CSS text for the current layout, or for the layout set if no
CSS text is configured in the current layout.
|
String |
getDefaultThemeSetting(String key,
String device,
boolean inheritLookAndFeel) |
List<com.liferay.portal.kernel.model.Portlet> |
getEmbeddedPortlets() |
List<com.liferay.portal.kernel.model.Portlet> |
getEmbeddedPortlets(long groupId) |
String |
getFriendlyURL(Locale locale)
Returns the layout's friendly URL for the given locale.
|
Map<Locale,String> |
getFriendlyURLMap()
Returns the friendly URLs for all configured locales.
|
String |
getFriendlyURLsXML() |
com.liferay.portal.kernel.model.Group |
getGroup()
Returns the current layout's group.
|
String |
getHTMLTitle(Locale locale)
Returns the current layout's HTML title for the given locale, or the
current layout's name for the given locale if no HTML title is
configured.
|
String |
getHTMLTitle(String localeLanguageId)
Returns the current layout's HTML title for the given locale language ID,
or the current layout's name if no HTML title is configured.
|
boolean |
getIconImage()
Returns
true if the current layout has a configured icon. |
com.liferay.portal.kernel.model.LayoutSet |
getLayoutSet()
Returns the current layout's
LayoutSet . |
com.liferay.portal.kernel.model.LayoutType |
getLayoutType()
Returns the current layout's
LayoutType . |
com.liferay.portal.kernel.model.Layout |
getLinkedToLayout()
Returns the current layout's linked layout.
|
long |
getParentPlid()
Returns the current layout's parent plid.
|
String |
getRegularURL(javax.servlet.http.HttpServletRequest request) |
String |
getResetLayoutURL(javax.servlet.http.HttpServletRequest request) |
String |
getResetMaxStateURL(javax.servlet.http.HttpServletRequest request) |
com.liferay.portal.kernel.model.Group |
getScopeGroup() |
String |
getTarget() |
com.liferay.portal.kernel.model.Theme |
getTheme()
Returns the current layout's theme, or the layout set's theme if no
layout theme is configured.
|
String |
getThemeSetting(String key,
String device) |
String |
getThemeSetting(String key,
String device,
boolean inheritLookAndFeel) |
String |
getTypeSettings() |
com.liferay.portal.kernel.util.UnicodeProperties |
getTypeSettingsProperties() |
String |
getTypeSettingsProperty(String key) |
String |
getTypeSettingsProperty(String key,
String defaultValue) |
boolean |
hasAncestor(long layoutId)
Returns
true if the given layout ID matches one of the
current layout's hierarchical parents. |
boolean |
hasChildren()
Returns
true if the current layout has child layouts. |
static boolean |
hasFriendlyURLKeyword(String friendlyURL) |
boolean |
hasScopeGroup() |
boolean |
hasSetModifiedDate() |
boolean |
includeLayoutContent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
boolean |
isChildSelected(boolean selectable,
com.liferay.portal.kernel.model.Layout layout) |
boolean |
isContentDisplayPage()
Returns
true if the current layout can be used as a content
display page. |
boolean |
isCustomizable() |
boolean |
isFirstChild()
Returns
true if the current layout is the first layout in
its parent's hierarchical list of children layouts. |
boolean |
isFirstParent()
Returns
true if the current layout is the topmost parent
layout. |
boolean |
isIconImage() |
boolean |
isInheritLookAndFeel()
Returns
true if the current layout utilizes its LayoutSet 's look and feel options (e.g. theme and color scheme). |
boolean |
isLayoutPrototypeLinkActive()
Returns
true if the current layout is built from a layout
template and still maintains an active connection to it. |
boolean |
isPortletEmbedded(String portletId,
long groupId) |
boolean |
isPublicLayout()
Returns
true if the current layout is part of the public
LayoutSet . |
boolean |
isRootLayout()
Returns
true if the current layout is the root layout. |
boolean |
isSelected(boolean selectable,
com.liferay.portal.kernel.model.Layout layout,
long ancestorPlid) |
boolean |
isSupportsEmbeddedPortlets()
Returns
true if the current layout can hold embedded
portlets. |
boolean |
isTypeArticle()
Deprecated.
As of Wilberforce (7.0.x), with no direct replacement
|
boolean |
isTypeControlPanel() |
boolean |
isTypeEmbedded() |
boolean |
isTypeLinkToLayout() |
boolean |
isTypePanel() |
boolean |
isTypePortlet() |
boolean |
isTypeSharedPortlet()
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
boolean |
isTypeURL() |
boolean |
matches(javax.servlet.http.HttpServletRequest request,
String friendlyURL) |
void |
setGroupId(long groupId) |
void |
setLayoutSet(com.liferay.portal.kernel.model.LayoutSet layoutSet) |
void |
setPrivateLayout(boolean privateLayout) |
void |
setTypeSettings(String typeSettings) |
void |
setTypeSettingsProperties(com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) |
static int |
validateFriendlyURL(String friendlyURL) |
static int |
validateFriendlyURL(String friendlyURL,
boolean checkMaxLength)
Checks whether the URL is a valid friendly URL.
|
static void |
validateFriendlyURLKeyword(String friendlyURL) |
persist
clone, compareTo, equals, getAvailableLanguageIds, getColorSchemeId, getColumnBitmask, getCompanyId, getCreateDate, getCss, getDefaultLanguageId, getDescription, getDescription, getDescription, getDescription, getDescription, getDescriptionCurrentLanguageId, getDescriptionCurrentValue, getDescriptionMap, getExpandoBridge, getFriendlyURL, getGroupId, getHidden, getIconImageId, getKeywords, getKeywords, getKeywords, getKeywords, getKeywords, getKeywordsCurrentLanguageId, getKeywordsCurrentValue, getKeywordsMap, getLastPublishDate, getLayoutId, getLayoutPrototypeLinkEnabled, getLayoutPrototypeUuid, getModelAttributes, getModelClass, getModelClassName, getModifiedDate, getMvccVersion, getName, getName, getName, getName, getName, getNameCurrentLanguageId, getNameCurrentValue, getNameMap, getOriginalCompanyId, getOriginalFriendlyURL, getOriginalGroupId, getOriginalIconImageId, getOriginalLayoutId, getOriginalLayoutPrototypeUuid, getOriginalParentLayoutId, getOriginalPriority, getOriginalPrivateLayout, getOriginalSourcePrototypeLayoutUuid, getOriginalType, getOriginalUuid, getParentLayoutId, getPlid, getPrimaryKey, getPrimaryKeyObj, getPriority, getPrivateLayout, getRobots, getRobots, getRobots, getRobots, getRobots, getRobotsCurrentLanguageId, getRobotsCurrentValue, getRobotsMap, getSourcePrototypeLayoutUuid, getStagedModelType, getThemeId, getTitle, getTitle, getTitle, getTitle, getTitle, getTitleCurrentLanguageId, getTitleCurrentValue, getTitleMap, getType, getUserId, getUserName, getUserUuid, getUuid, hashCode, isEntityCacheEnabled, isFinderCacheEnabled, isHidden, isLayoutPrototypeLinkEnabled, isPrivateLayout, prepareLocalizedFieldsForImport, prepareLocalizedFieldsForImport, resetOriginalValues, setColorSchemeId, setCompanyId, setCreateDate, setCss, setDescription, setDescription, setDescription, setDescriptionCurrentLanguageId, setDescriptionMap, setDescriptionMap, setExpandoBridgeAttributes, setFriendlyURL, setHidden, setIconImageId, setKeywords, setKeywords, setKeywords, setKeywordsCurrentLanguageId, setKeywordsMap, setKeywordsMap, setLastPublishDate, setLayoutId, setLayoutPrototypeLinkEnabled, setLayoutPrototypeUuid, setModelAttributes, setModifiedDate, setMvccVersion, setName, setName, setName, setNameCurrentLanguageId, setNameMap, setNameMap, setParentLayoutId, setPlid, setPrimaryKey, setPrimaryKeyObj, setPriority, setRobots, setRobots, setRobots, setRobotsCurrentLanguageId, setRobotsMap, setRobotsMap, setSourcePrototypeLayoutUuid, setThemeId, setTitle, setTitle, setTitle, setTitleCurrentLanguageId, setTitleMap, setTitleMap, setType, setUserId, setUserName, setUserUuid, setUuid, toCacheModel, toEscapedModel, toModel, toModels, toString, toXmlString
getLocale, isCachedModel, isEscapedModel, isNew, setCachedModel, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setNew, toUnescapedModel
clone, compareTo, getAvailableLanguageIds, getColorSchemeId, getCompanyId, getCreateDate, getCss, getDefaultLanguageId, getDescription, getDescription, getDescription, getDescription, getDescription, getDescriptionCurrentLanguageId, getDescriptionCurrentValue, getDescriptionMap, getExpandoBridge, getFriendlyURL, getGroupId, getHidden, getIconImageId, getKeywords, getKeywords, getKeywords, getKeywords, getKeywords, getKeywordsCurrentLanguageId, getKeywordsCurrentValue, getKeywordsMap, getLastPublishDate, getLayoutId, getLayoutPrototypeLinkEnabled, getLayoutPrototypeUuid, getModifiedDate, getMvccVersion, getName, getName, getName, getName, getName, getNameCurrentLanguageId, getNameCurrentValue, getNameMap, getParentLayoutId, getPlid, getPrimaryKey, getPrimaryKeyObj, getPriority, getPrivateLayout, getRobots, getRobots, getRobots, getRobots, getRobots, getRobotsCurrentLanguageId, getRobotsCurrentValue, getRobotsMap, getSourcePrototypeLayoutUuid, getThemeId, getTitle, getTitle, getTitle, getTitle, getTitle, getTitleCurrentLanguageId, getTitleCurrentValue, getTitleMap, getType, getUserId, getUserName, getUserUuid, getUuid, hashCode, isCachedModel, isEscapedModel, isHidden, isLayoutPrototypeLinkEnabled, isNew, isPrivateLayout, prepareLocalizedFieldsForImport, prepareLocalizedFieldsForImport, setCachedModel, setColorSchemeId, setCompanyId, setCreateDate, setCss, setDescription, setDescription, setDescription, setDescriptionCurrentLanguageId, setDescriptionMap, setDescriptionMap, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setFriendlyURL, setHidden, setIconImageId, setKeywords, setKeywords, setKeywords, setKeywordsCurrentLanguageId, setKeywordsMap, setKeywordsMap, setLastPublishDate, setLayoutId, setLayoutPrototypeLinkEnabled, setLayoutPrototypeUuid, setModifiedDate, setMvccVersion, setName, setName, setName, setNameCurrentLanguageId, setNameMap, setNameMap, setNew, setParentLayoutId, setPlid, setPrimaryKey, setPrimaryKeyObj, setPriority, setRobots, setRobots, setRobots, setRobotsCurrentLanguageId, setRobotsMap, setRobotsMap, setSourcePrototypeLayoutUuid, setThemeId, setTitle, setTitle, setTitle, setTitleCurrentLanguageId, setTitleMap, setTitleMap, setType, setUserId, setUserName, setUserUuid, setUuid, toCacheModel, toEscapedModel, toString, toUnescapedModel, toXmlString
getModelAttributes, isEntityCacheEnabled, isFinderCacheEnabled, resetOriginalValues, setModelAttributes
public static boolean hasFriendlyURLKeyword(String friendlyURL)
public static int validateFriendlyURL(String friendlyURL)
public static int validateFriendlyURL(String friendlyURL, boolean checkMaxLength)
friendlyURL
- the URL to be checkedcheckMaxLength
- whether to check that the URL's length does not
exceed the maximum length-1
if the URL is a valid friendly URL; a LayoutFriendlyURLException
constant otherwisepublic static void validateFriendlyURLKeyword(String friendlyURL) throws com.liferay.portal.kernel.exception.LayoutFriendlyURLException
com.liferay.portal.kernel.exception.LayoutFriendlyURLException
public List<com.liferay.portal.kernel.model.Layout> getAllChildren()
public long getAncestorLayoutId() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public long getAncestorPlid() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Layout> getAncestors() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public List<com.liferay.portal.kernel.model.Layout> getChildren()
public List<com.liferay.portal.kernel.model.Layout> getChildren(com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker) throws com.liferay.portal.kernel.exception.PortalException
permissionChecker
- the user-specific context to check permissionscom.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.ColorScheme getColorScheme() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public String getCssText() throws com.liferay.portal.kernel.exception.PortalException
Layouts and layout sets can configure CSS that is applied in addition to the theme's CSS.
com.liferay.portal.kernel.exception.PortalException
public String getDefaultThemeSetting(String key, String device, boolean inheritLookAndFeel)
public List<com.liferay.portal.kernel.model.Portlet> getEmbeddedPortlets()
public List<com.liferay.portal.kernel.model.Portlet> getEmbeddedPortlets(long groupId)
public String getFriendlyURL(Locale locale)
locale
- the locale that the friendly URL should be retrieved forpublic Map<Locale,String> getFriendlyURLMap()
public String getFriendlyURLsXML()
public com.liferay.portal.kernel.model.Group getGroup() throws com.liferay.portal.kernel.exception.PortalException
Group is Liferay's technical name for a site.
com.liferay.portal.kernel.exception.PortalException
public String getHTMLTitle(Locale locale)
locale
- the locale that the HTML title should be retrieved forpublic String getHTMLTitle(String localeLanguageId)
localeLanguageId
- the locale that the HTML title should be
retrieved forpublic boolean getIconImage()
true
if the current layout has a configured icon.true
if the current layout has a configured icon;
false
otherwisepublic com.liferay.portal.kernel.model.LayoutSet getLayoutSet() throws com.liferay.portal.kernel.exception.PortalException
LayoutSet
.com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.LayoutType getLayoutType()
LayoutType
.public com.liferay.portal.kernel.model.Layout getLinkedToLayout()
null
if no
linked layout could be foundpublic long getParentPlid() throws com.liferay.portal.kernel.exception.PortalException
0
if the
current layout is the topmost parent layoutcom.liferay.portal.kernel.exception.PortalException
public String getRegularURL(javax.servlet.http.HttpServletRequest request) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public String getResetLayoutURL(javax.servlet.http.HttpServletRequest request) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public String getResetMaxStateURL(javax.servlet.http.HttpServletRequest request) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public com.liferay.portal.kernel.model.Group getScopeGroup() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public String getTarget()
public com.liferay.portal.kernel.model.Theme getTheme() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public String getThemeSetting(String key, String device)
public String getThemeSetting(String key, String device, boolean inheritLookAndFeel)
public String getTypeSettings()
getTypeSettings
in interface com.liferay.portal.kernel.model.LayoutModel
getTypeSettings
in class LayoutModelImpl
public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties()
public String getTypeSettingsProperty(String key)
public String getTypeSettingsProperty(String key, String defaultValue)
public boolean hasAncestor(long layoutId) throws com.liferay.portal.kernel.exception.PortalException
true
if the given layout ID matches one of the
current layout's hierarchical parents.layoutId
- the layout ID to search for in the current layout's
parent listtrue
if the given layout ID matches one of the
current layout's hierarchical parents; false
otherwisecom.liferay.portal.kernel.exception.PortalException
public boolean hasChildren()
true
if the current layout has child layouts.true
if the current layout has child layouts,
false
otherwisepublic boolean hasScopeGroup() throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public boolean hasSetModifiedDate()
hasSetModifiedDate
in interface com.liferay.portal.kernel.model.Layout
hasSetModifiedDate
in class LayoutModelImpl
public boolean includeLayoutContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Exception
public boolean isChildSelected(boolean selectable, com.liferay.portal.kernel.model.Layout layout) throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException
public boolean isContentDisplayPage()
true
if the current layout can be used as a content
display page.
A content display page must have an Asset Publisher portlet that is configured as the default Asset Publisher for the layout.
true
if the current layout can be used as a content
display page; false
otherwisepublic boolean isCustomizable()
public boolean isFirstChild()
true
if the current layout is the first layout in
its parent's hierarchical list of children layouts.true
if the current layout is the first layout in
its parent's hierarchical list of children layouts;
false
otherwisepublic boolean isFirstParent()
true
if the current layout is the topmost parent
layout.true
if the current layout is the topmost parent
layout; false
otherwisepublic boolean isIconImage()
public boolean isInheritLookAndFeel()
true
if the current layout utilizes its LayoutSet
's look and feel options (e.g. theme and color scheme).true
if the current layout utilizes its layout set's
look and feel options; false
otherwisepublic boolean isLayoutPrototypeLinkActive()
true
if the current layout is built from a layout
template and still maintains an active connection to it.true
if the current layout is built from a layout
template and still maintains an active connection to it;
false
otherwisepublic boolean isPortletEmbedded(String portletId, long groupId)
public boolean isPublicLayout()
true
if the current layout is part of the public
LayoutSet
.
Note, the returned value reflects the layout's default access options, not its access permissions.
true
if the current layout is part of the public
layout set; false
otherwisepublic boolean isRootLayout()
true
if the current layout is the root layout.true
if the current layout is the root layout;
false
otherwisepublic boolean isSelected(boolean selectable, com.liferay.portal.kernel.model.Layout layout, long ancestorPlid)
public boolean isSupportsEmbeddedPortlets()
true
if the current layout can hold embedded
portlets.true
if the current layout can hold embedded
portlets; false
otherwise@Deprecated public boolean isTypeArticle()
public boolean isTypeControlPanel()
public boolean isTypeEmbedded()
public boolean isTypeLinkToLayout()
public boolean isTypePanel()
public boolean isTypePortlet()
@Deprecated public boolean isTypeSharedPortlet()
public boolean isTypeURL()
public boolean matches(javax.servlet.http.HttpServletRequest request, String friendlyURL)
public void setGroupId(long groupId)
setGroupId
in interface com.liferay.portal.kernel.model.GroupedModel
setGroupId
in interface com.liferay.portal.kernel.model.LayoutModel
setGroupId
in class LayoutModelImpl
public void setLayoutSet(com.liferay.portal.kernel.model.LayoutSet layoutSet)
public void setPrivateLayout(boolean privateLayout)
setPrivateLayout
in interface com.liferay.portal.kernel.model.LayoutModel
setPrivateLayout
in class LayoutModelImpl
public void setTypeSettings(String typeSettings)
setTypeSettings
in interface com.liferay.portal.kernel.model.LayoutModel
setTypeSettings
in class LayoutModelImpl
public void setTypeSettingsProperties(com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties)