@Service public class NavigationItemService extends Object
Constructor and Description |
---|
NavigationItemService() |
Modifier and Type | Method and Description |
---|---|
void |
createBuiltInNavigationItems(Long userId)
Create the built-in navigation items for the provided user if they do not yet exist.
|
void |
delete(Long navigationItemId)
Deletes the given item.
|
List<NavigationItemTO<NavigationItemDataTO>> |
find(Long... navigationItemIds)
Get the matching navigation items of the current user.
|
NavigationItemTO<NavigationItemDataTO> |
get(Long navigationItemId)
Get a specific navigation item.
|
Long |
store(String name,
Integer index,
Date lastAccessDate,
NavigationItemDataTO data)
Create a navigation item for the current user.
|
Long |
update(Long navigationItemId,
String name,
Integer index,
Date lastAccessDate,
NavigationItemDataTO data)
Update a navigation item of the current user.
|
public void createBuiltInNavigationItems(Long userId) throws AuthorizationException
userId
- The ID of the user for whom the items should be created, if omitted the current
user will be takenAuthorizationException
- If the current user is not the provided user or the internal system userpublic void delete(Long navigationItemId) throws AuthorizationException
navigationItemId
- Item to delete.AuthorizationException
- in case the current user is not the owner of the itempublic List<NavigationItemTO<NavigationItemDataTO>> find(Long... navigationItemIds)
navigationItemIds
- IDs of the items to load. Provide no ID to get allpublic NavigationItemTO<NavigationItemDataTO> get(Long navigationItemId)
navigationItemId
- ID of the item to getpublic Long store(String name, Integer index, Date lastAccessDate, NavigationItemDataTO data) throws NavigationItemDataSerializationException
name
- The name to set.index
- Index of the item. If null the index will be 0.lastAccessDate
- The last access date. If null the current date will be used.data
- The data.NavigationItemDataSerializationException
- in case the data can not be converted into a stringpublic Long update(Long navigationItemId, String name, Integer index, Date lastAccessDate, NavigationItemDataTO data) throws NotFoundException, NavigationItemDataSerializationException
navigationItemId
- Id of the item to update.name
- The name to set. If null the current name will be used.index
- Index of the item. If null, this will not be updated.lastAccessDate
- The last access date. If null, this will not be updated.data
- The data. If null, this will not be updated.NotFoundException
- in case the item to update does not exist or does not belong to the current userNavigationItemDataSerializationException
- in case the data can not be converted into a stringCopyright © 2019 Communote team. All rights reserved.