Class FavoritesRestController
- java.lang.Object
-
- org.neotropic.kuwaiba.northbound.rest.aem.FavoritesRestController
-
- All Implemented Interfaces:
FavoritesRestOpenApi
@RestController @RequestMapping("/v2.1.1/favorites/") public class FavoritesRestController extends Object implements FavoritesRestOpenApi
The definition of the Favorites Rest Controller.- Author:
- Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description FavoritesRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObjectTofavoritesFolder(String className, String objectId, long folderId, long userId, String sessionId)
Adds an object to the favorites folder.long
createFavoritesFolderForUser(String name, long userId, String sessionId)
Create a relationship between an user and a new favorites folder.void
deleteFavoritesFolders(long[] ids, long userId, String sessionId)
Delete a Bookmark Folder of an User.FavoritesFolder
getFavoritesFolder(long folderId, long userId, String sessionId)
Gets a favorites folder.List<FavoritesFolder>
getFavoritesFoldersForObject(long userId, String className, String objectId, String sessionId)
Get the bookmarks where an object is associated.List<FavoritesFolder>
getFavoritesFoldersForUser(long userId, String sessionId)
Get the favorites folders create by an user.List<BusinessObjectLight>
getObjectsInFavoritesFolder(long folderId, long userId, int limit, String sessionId)
Get the object assigned to the bookmark.void
removeObjectFromfavoritesFolder(String className, String objectId, long folderId, long userId, String sessionId)
Removes an object associated to a favorites folder.void
updateFavoritesFolder(long folderId, long userId, String name, String sessionId)
Updates a favorites folder.
-
-
-
Field Detail
-
PATH
public static final String PATH
Path that includes the Kuwaiba version and the module id- See Also:
- Constant Field Values
-
-
Method Detail
-
addObjectTofavoritesFolder
@RequestMapping(method=PUT, value="addObjectTofavoritesFolder/{className}/{objectId}/{folderId}/{userId}/{sessionId}", produces="application/json") public void addObjectTofavoritesFolder(@PathVariable("className") String className, @PathVariable("objectId") String objectId, @PathVariable("folderId") long folderId, @PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Adds an object to the favorites folder.- Specified by:
addObjectTofavoritesFolder
in interfaceFavoritesRestOpenApi
- Parameters:
className
- Object class name.objectId
- Object id.folderId
- Favorites folder id.userId
- User id.sessionId
- The session token id.
-
removeObjectFromfavoritesFolder
@RequestMapping(method=DELETE, value="removeObjectFromfavoritesFolder/{className}/{objectId}/{folderId}/{userId}/{sessionId}", produces="application/json") public void removeObjectFromfavoritesFolder(@PathVariable("className") String className, @PathVariable("objectId") String objectId, @PathVariable("folderId") long folderId, @PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Removes an object associated to a favorites folder.- Specified by:
removeObjectFromfavoritesFolder
in interfaceFavoritesRestOpenApi
- Parameters:
className
- Object class name.objectId
- Object id.folderId
- favorites folder id.userId
- User id.sessionId
- The session token id.
-
createFavoritesFolderForUser
@RequestMapping(method=POST, value="createFavoritesFolderForUser/{name}/{userId}/{sessionId}", produces="application/json") public long createFavoritesFolderForUser(@PathVariable("name") String name, @PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Create a relationship between an user and a new favorites folder.- Specified by:
createFavoritesFolderForUser
in interfaceFavoritesRestOpenApi
- Parameters:
name
- Favorites folder name.userId
- User id.sessionId
- The session token id.- Returns:
- The new favorites folder id.
-
deleteFavoritesFolders
@RequestMapping(method=DELETE, value="deleteFavoritesFolders/{ids}/{userId}/{sessionId}", produces="application/json") public void deleteFavoritesFolders(@PathVariable("ids") long[] ids, @PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Delete a Bookmark Folder of an User.- Specified by:
deleteFavoritesFolders
in interfaceFavoritesRestOpenApi
- Parameters:
ids
- Favorites folders id.userId
- User id.sessionId
- The session token id.
-
getFavoritesFoldersForUser
@RequestMapping(method=GET, value="getFavoritesFoldersForUser/{userId}/{sessionId}", produces="application/json") public List<FavoritesFolder> getFavoritesFoldersForUser(@PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Get the favorites folders create by an user.- Specified by:
getFavoritesFoldersForUser
in interfaceFavoritesRestOpenApi
- Parameters:
userId
- user id.sessionId
- The session token id.- Returns:
- List of Bookmarks folders for an User.
-
getObjectsInFavoritesFolder
@RequestMapping(method=GET, value="getObjectsInFavoritesFolder/{folderId}/{userId}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getObjectsInFavoritesFolder(@PathVariable("folderId") long folderId, @PathVariable("userId") long userId, @PathVariable("limit") int limit, @PathVariable("sessionId") String sessionId)
Get the object assigned to the bookmark.- Specified by:
getObjectsInFavoritesFolder
in interfaceFavoritesRestOpenApi
- Parameters:
folderId
- Favorites folder id.userId
- User id.limit
- Max number of results.sessionId
- The session token id.- Returns:
- List of objects related to bookmark.
-
getFavoritesFoldersForObject
@RequestMapping(method=GET, value="getFavoritesFoldersForObject/{userId}/{className}/{objectId}/{sessionId}", produces="application/json") public List<FavoritesFolder> getFavoritesFoldersForObject(@PathVariable("userId") long userId, @PathVariable("className") String className, @PathVariable("objectId") String objectId, @PathVariable("sessionId") String sessionId)
Get the bookmarks where an object is associated.- Specified by:
getFavoritesFoldersForObject
in interfaceFavoritesRestOpenApi
- Parameters:
userId
- User id.className
- Object class name.objectId
- Object id.sessionId
- The session token id.- Returns:
- List of favorites folders where an object are an item.
-
getFavoritesFolder
@RequestMapping(method=GET, value="getFavoritesFolder/{folderId}/{userId}/{sessionId}", produces="application/json") public FavoritesFolder getFavoritesFolder(@PathVariable("folderId") long folderId, @PathVariable("userId") long userId, @PathVariable("sessionId") String sessionId)
Gets a favorites folder.- Specified by:
getFavoritesFolder
in interfaceFavoritesRestOpenApi
- Parameters:
folderId
- Favorites folder id.userId
- User id.sessionId
- The session token id.- Returns:
- The favorite folder with id.
-
updateFavoritesFolder
@RequestMapping(method=PUT, value="updateFavoritesFolder/{folderId}/{userId}/{name}/{sessionId}", produces="application/json") public void updateFavoritesFolder(@PathVariable("folderId") long folderId, @PathVariable("userId") long userId, @PathVariable("name") String name, @PathVariable("sessionId") String sessionId)
Updates a favorites folder.- Specified by:
updateFavoritesFolder
in interfaceFavoritesRestOpenApi
- Parameters:
folderId
- Favorites folder iduserId
- User id.name
- Favorites folder name.sessionId
- The favorite folder with id.
-
-