Interface UADDisplay<T>
- All Superinterfaces:
UADComponent<T>
- All Known Implementing Classes:
BaseModelUADDisplay
Provides the methods to count, retrieve, and display information about type
T
entities related to a user. This interface can also provide a URL
to allow an admin to edit an entity.-
Method Summary
Modifier and TypeMethodDescriptionlong
count
(long userId) Returns the number of typeT
entities associated with the the user.get
(Serializable primaryKey) Retrieves a typeT
entity.default String[]
Returns field names to be used as table column headers when displaying a list of typeT
entities.String[]
Returns field names to display when showing details about a typeT
entity.default String
getEditURL
(T t, com.liferay.portal.kernel.portlet.LiferayPortletRequest liferayPortletRequest, com.liferay.portal.kernel.portlet.LiferayPortletResponse liferayPortletResponse) Returns a string URL that allows the admin user to edit the entity.getFieldValues
(T t, String[] fieldNames, Locale locale) Returns a map of field names and values to display in the UI.default String
default Class<?>
default Serializable
Returns the primary key of the parent container for the given entity.default String
getPrimaryKey
(T t) Returns the primary key of the typeT
entity.getRange
(long userId, int start, int end) Returns typeT
entities in the given range associated with a user.String[]
Returns the field names to be used as table column headers when sorting typeT
entities.default T
getTopLevelContainer
(Class<?> parentContainerClass, Serializable parentContainerId, Object childObject) Returns the typeT
entity that satisfies two conditions: It is an immediate child of the container identified by the parent container class and parent container ID.getTypeName
(Locale locale) Returns the localized string representing typeT
.boolean
default boolean
Returnstrue
if typeT
entities are scoped by site.default boolean
isTypeEntity
(Object object) default boolean
isUserOwned
(T t, long userId) search
(long userId, long[] groupIds, String keywords, String orderByField, String orderByType, int start, int end) Returns paginated sorted typeT
entities related to the user, optionally filtered by groups and/or keywords.long
searchCount
(long userId, long[] groupIds, String keywords) Returns the number of typeT
entities related to the user, optionally filtered by groups and/or keywords.Methods inherited from interface com.liferay.user.associated.data.component.UADComponent
getTypeClass, getTypeKey
-
Method Details
-
count
long count(long userId) Returns the number of typeT
entities associated with the the user.- Parameters:
userId
- the primary key of the user whose data to count- Returns:
- the number of entities associated with the user
-
get
Retrieves a typeT
entity.- Parameters:
primaryKey
- the primary key of the entity to retrieve- Returns:
- an entity of type
T
- Throws:
Exception
- if an exception occurred
-
getColumnFieldNames
Returns field names to be used as table column headers when displaying a list of typeT
entities.- Returns:
- the field names used for column headers
-
getDisplayFieldNames
String[] getDisplayFieldNames()Returns field names to display when showing details about a typeT
entity.- Returns:
- the field names identifying which information to display
-
getEditURL
default String getEditURL(T t, com.liferay.portal.kernel.portlet.LiferayPortletRequest liferayPortletRequest, com.liferay.portal.kernel.portlet.LiferayPortletResponse liferayPortletResponse) throws Exception Returns a string URL that allows the admin user to edit the entity. Ifnull
is returned, no edit option is presented to the admin user.- Parameters:
t
- the typeT
entityliferayPortletRequest
- the current portlet requestliferayPortletResponse
- the current portlet response- Returns:
- a string URL, or
null
- Throws:
Exception
- if an exception occurred
-
getFieldValues
Returns a map of field names and values to display in the UI.- Parameters:
t
- the typeT
entityfieldNames
- the field names for getting values from the entitylocale
- the current locale- Returns:
- a map of values to display in the UI
-
getName
-
getParentContainerClass
-
getParentContainerId
Returns the primary key of the parent container for the given entity.This method is optional and only applies when the implementation is returned from
UADHierarchyDeclaration.getContainerUADDisplays()
orUADHierarchyDeclaration.getNoncontainerUADDisplays()
. It is required for hierarchy display to function correctly, but not for normal usage.- Parameters:
t
- the entity whose parent container's primary key to retreive- Returns:
- the primary key of the parent container of the given entity
- See Also:
-
getParentContainerTypeKey
-
getPrimaryKey
Returns the primary key of the typeT
entity.- Parameters:
t
- the entity whose primary key to retrieve- Returns:
- the primary key of the entity
-
getRange
Returns typeT
entities in the given range associated with a user.- Parameters:
start
- the starting index of the result set, for paginationend
- the ending index of the result set, for pagination- Returns:
- the paginated entities related to the user ID
-
getSortingFieldNames
String[] getSortingFieldNames()Returns the field names to be used as table column headers when sorting typeT
entities.- Returns:
- the field names used for column headers when sorting
-
getTopLevelContainer
default T getTopLevelContainer(Class<?> parentContainerClass, Serializable parentContainerId, Object childObject) Returns the typeT
entity that satisfies two conditions:- It is an immediate child of the container identified by the parent container class and parent container ID.
- It is an ancestor of the child object. It does not have to be an immediate ancestor.
If neither of these conditions are met, this method should return
null
.This method is optional and only applies when the implementation is returned from
UADHierarchyDeclaration.getContainerUADDisplays()
. It is required for hierarchy display to function correctly, but not for normal usage.- Parameters:
parentContainerClass
- the class identifying the returned entity's parent containerparentContainerId
- the primary key of the returned entity's parent containerchildObject
- the returned entity's child- Returns:
- the highest level parent of the child object that is also a child of the given container type and primary key
- See Also:
-
getTypeName
Returns the localized string representing typeT
.- Parameters:
locale
- the current locale- Returns:
- the localized string representing type
T
-
isInTrash
-
isSiteScoped
default boolean isSiteScoped()Returnstrue
if typeT
entities are scoped by site.- Returns:
true
if typeT
entities are scoped by site;false
otherwise
-
isTypeEntity
-
isUserOwned
-
search
List<T> search(long userId, long[] groupIds, String keywords, String orderByField, String orderByType, int start, int end) Returns paginated sorted typeT
entities related to the user, optionally filtered by groups and/or keywords.- Parameters:
userId
- the primary key of the usergroupIds
- the primary keys of the groups that the entities are associated withkeywords
- the keywords which may occur in the entity's fieldsorderByField
- the field to sort the entities byorderByType
- the direction to sort the entities by (ascending or descending)start
- the result set's starting indexend
- the result set's ending index- Returns:
- the paginated, sorted, and filtered entities associated with the user
-
searchCount
Returns the number of typeT
entities related to the user, optionally filtered by groups and/or keywords.- Parameters:
userId
- the primary key of the usergroupIds
- the primary keys of the groups that the entities are associated withkeywords
- the keywords which may occur in the entity's fields- Returns:
- the number of filtered entities associated with the user
-