@Service public class NavigationItemManagementImpl extends Object implements NavigationItemManagement
Constructor and Description |
---|
NavigationItemManagementImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
createBuiltInNavigationItems(Long userId)
Create the built-in immutable navigation items for the current user if they do not yet exist.
|
boolean |
delete(Long navigationItemId)
Delete a given item.
|
<DATA_TYPE extends NavigationItemDataTO> |
find(Class<DATA_TYPE> type,
Long... navigationItemIds)
Method to find all items for the current user.
|
<T> Collection<T> |
get(CollectionConverter<NavigationItem,T> converter,
Long... ids)
Method to find all navigation items for the current user.
|
<DATA_TYPE extends NavigationItemDataTO> |
get(Long notificationItemId,
Class<DATA_TYPE> type)
Method to get an item for the given user.
|
<T extends NavigationItemDataTO> |
store(NavigationItemTO<T> navigationItem)
Updates the given item or creates a new one.
|
@Transactional(propagation=REQUIRED) public boolean createBuiltInNavigationItems(Long userId) throws AuthorizationException
createBuiltInNavigationItems
in interface NavigationItemManagement
userId
- The ID of the user to updateAuthorizationException
- If the current user is not the provided user or the internal system user@Transactional(propagation=REQUIRED) public boolean delete(Long navigationItemId) throws AuthorizationException
delete
in interface NavigationItemManagement
navigationItemId
- ID of the item to delete.AuthorizationException
- in case the current user is not the owner of the item@Transactional(readOnly=true) public <DATA_TYPE extends NavigationItemDataTO> List<NavigationItemTO<DATA_TYPE>> find(Class<DATA_TYPE> type, Long... navigationItemIds) throws NavigationItemDataSerializationException
find
in interface NavigationItemManagement
DATA_TYPE
- the type of the data of the itemtype
- the type of the data of the itemnavigationItemIds
- Id's of items to load or null, if all.NavigationItemDataSerializationException
- Thrown, when the given data can't be converted into the given type.@Transactional(readOnly=true) public <T> Collection<T> get(CollectionConverter<NavigationItem,T> converter, Long... ids)
get
in interface NavigationItemManagement
T
- Type of the result.converter
- The converter to use for result converting.ids
- Ids of items to get or null to get all items.@Transactional(readOnly=true) public <DATA_TYPE extends NavigationItemDataTO> NavigationItemTO<DATA_TYPE> get(Long notificationItemId, Class<DATA_TYPE> type) throws NavigationItemDataSerializationException
get
in interface NavigationItemManagement
DATA_TYPE
- the type of the data of the itemnotificationItemId
- Id of the item to get.type
- Type of the data, if null, the data won't be deserialized.NavigationItemDataSerializationException
- Thrown, when the given data can't be converted into the given type.@Transactional(propagation=REQUIRED) public <T extends NavigationItemDataTO> Long store(NavigationItemTO<T> navigationItem) throws AuthorizationException, NavigationItemDataSerializationException
store
in interface NavigationItemManagement
T
- the type of the data of the itemnavigationItem
- Item to update.AuthorizationException
- in case the item to update exists but the current user is not the owner of itNavigationItemDataSerializationException
- Thrown, when the given data can't be converted into JSONCopyright © 2019 Communote team. All rights reserved.