public interface UADDisplay<T> extends UADComponent<T>
T
entities related to a user. This interface can also provide a URL
to allow an admin to edit an entity.Modifier and Type | Method and Description |
---|---|
long |
count(long userId)
Returns the number of type
T entities associated with the the
user. |
T |
get(java.io.Serializable primaryKey)
Retrieves a type
T entity. |
default java.lang.String[] |
getColumnFieldNames()
Returns field names to be used as table column headers when displaying a
list of type
T entities. |
java.lang.String[] |
getDisplayFieldNames()
Returns field names to display when showing details about a type
T entity. |
default java.lang.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.
|
java.util.Map<java.lang.String,java.lang.Object> |
getFieldValues(T t,
java.lang.String[] fieldNames,
java.util.Locale locale)
Returns a map of field names and values to display in the UI.
|
default java.lang.String |
getName(T t,
java.util.Locale locale) |
default java.lang.Class<?> |
getParentContainerClass() |
default java.io.Serializable |
getParentContainerId(T t)
Returns the primary key of the parent container for the given entity.
|
java.io.Serializable |
getPrimaryKey(T t)
Returns the primary key of the type
T entity. |
java.util.List<T> |
getRange(long userId,
int start,
int end)
Returns type
T entities in the given range associated with a
user. |
java.lang.String[] |
getSortingFieldNames()
Returns the field names to be used as table column headers when sorting
type
T entities. |
default T |
getTopLevelContainer(java.lang.Class<?> parentContainerClass,
java.io.Serializable parentContainerId,
java.lang.Object childObject)
Returns the type
T entity that satisfies two conditions:
It is an immediate child of the container identified by the parent
container class and parent container ID. |
java.lang.String |
getTypeName(java.util.Locale locale)
Returns the localized string representing type
T . |
boolean |
isInTrash(T t) |
default boolean |
isSiteScoped()
Returns
true if type T entities are scoped by site. |
default boolean |
isUserOwned(T t,
long userId) |
java.util.List<T> |
search(long userId,
long[] groupIds,
java.lang.String keywords,
java.lang.String orderByField,
java.lang.String orderByType,
int start,
int end)
Returns paginated sorted type
T entities related to the user,
optionally filtered by groups and/or keywords. |
long |
searchCount(long userId,
long[] groupIds,
java.lang.String keywords)
Returns the number of type
T entities related to the user,
optionally filtered by groups and/or keywords. |
getTypeClass
long count(long userId)
T
entities associated with the the
user.userId
- the primary key of the user whose data to countT get(java.io.Serializable primaryKey) throws java.lang.Exception
T
entity.primaryKey
- the primary key of the entity to retrieveT
java.lang.Exception
- if an exception occurreddefault java.lang.String[] getColumnFieldNames()
T
entities.java.lang.String[] getDisplayFieldNames()
T
entity.default java.lang.String getEditURL(T t, com.liferay.portal.kernel.portlet.LiferayPortletRequest liferayPortletRequest, com.liferay.portal.kernel.portlet.LiferayPortletResponse liferayPortletResponse) throws java.lang.Exception
null
is returned, no edit option is presented to the admin user.t
- the type T
entityliferayPortletRequest
- the current portlet requestliferayPortletResponse
- the current portlet responsenull
java.lang.Exception
- if an exception occurredjava.util.Map<java.lang.String,java.lang.Object> getFieldValues(T t, java.lang.String[] fieldNames, java.util.Locale locale)
t
- the type T
entityfieldNames
- the field names for getting values from the entitylocale
- the current localedefault java.lang.String getName(T t, java.util.Locale locale)
default java.lang.Class<?> getParentContainerClass()
default java.io.Serializable getParentContainerId(T t)
This method is optional and only applies when the implementation is
returned from UADHierarchyDeclaration.getContainerUADDisplays()
or UADHierarchyDeclaration.getNoncontainerUADDisplays()
. It is
required for hierarchy display to function correctly, but not for normal
usage.
t
- the entity whose parent container's primary key to retreiveUADHierarchyDeclaration
java.io.Serializable getPrimaryKey(T t)
T
entity.t
- the entity whose primary key to retrievejava.util.List<T> getRange(long userId, int start, int end)
T
entities in the given range associated with a
user.start
- the starting index of the result set, for paginationend
- the ending index of the result set, for paginationjava.lang.String[] getSortingFieldNames()
T
entities.default T getTopLevelContainer(java.lang.Class<?> parentContainerClass, java.io.Serializable parentContainerId, java.lang.Object childObject)
T
entity that satisfies two conditions:
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.
parentContainerClass
- the class identifying the returned entity's
parent containerparentContainerId
- the primary key of the returned entity's parent
containerchildObject
- the returned entity's childUADHierarchyDeclaration
java.lang.String getTypeName(java.util.Locale locale)
T
.locale
- the current localeT
boolean isInTrash(T t) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
default boolean isSiteScoped()
true
if type T
entities are scoped by site.true
if type T
entities are scoped by site;
false
otherwisedefault boolean isUserOwned(T t, long userId)
java.util.List<T> search(long userId, long[] groupIds, java.lang.String keywords, java.lang.String orderByField, java.lang.String orderByType, int start, int end)
T
entities related to the user,
optionally filtered by groups and/or keywords.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 indexlong searchCount(long userId, long[] groupIds, java.lang.String keywords)
T
entities related to the user,
optionally filtered by groups and/or keywords.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