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 TypeMethodDescriptionlongcount(long userId) Returns the number of typeTentities associated with the the user.get(Serializable primaryKey) Retrieves a typeTentity.default String[]Returns field names to be used as table column headers when displaying a list of typeTentities.String[]Returns field names to display when showing details about a typeTentity.default StringgetEditURL(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 Stringdefault Class<?> default SerializableReturns the primary key of the parent container for the given entity.default StringgetPrimaryKey(T t) Returns the primary key of the typeTentity.getRange(long userId, int start, int end) Returns typeTentities in the given range associated with a user.String[]Returns the field names to be used as table column headers when sorting typeTentities.default TgetTopLevelContainer(Class<?> parentContainerClass, Serializable parentContainerId, Object childObject) Returns the typeTentity 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.booleandefault booleanReturnstrueif typeTentities are scoped by site.default booleanisTypeEntity(Object object) default booleanisUserOwned(T t, long userId) search(long userId, long[] groupIds, String keywords, String orderByField, String orderByType, int start, int end) Returns paginated sorted typeTentities related to the user, optionally filtered by groups and/or keywords.longsearchCount(long userId, long[] groupIds, String keywords) Returns the number of typeTentities 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 typeTentities 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 typeTentity.- 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 typeTentities.- Returns:
- the field names used for column headers
-
getDisplayFieldNames
String[] getDisplayFieldNames()Returns field names to display when showing details about a typeTentity.- 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. Ifnullis returned, no edit option is presented to the admin user.- Parameters:
t- the typeTentityliferayPortletRequest- 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 typeTentityfieldNames- 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 typeTentity.- Parameters:
t- the entity whose primary key to retrieve- Returns:
- the primary key of the entity
-
getRange
Returns typeTentities 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 typeTentities.- Returns:
- the field names used for column headers when sorting
-
getTopLevelContainer
default T getTopLevelContainer(Class<?> parentContainerClass, Serializable parentContainerId, Object childObject) Returns the typeTentity 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()Returnstrueif typeTentities are scoped by site.- Returns:
trueif typeTentities are scoped by site;falseotherwise
-
isTypeEntity
-
isUserOwned
-
search
List<T> search(long userId, long[] groupIds, String keywords, String orderByField, String orderByType, int start, int end) Returns paginated sorted typeTentities 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 typeTentities 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
-