Class 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 Detail

      • FavoritesRestController

        public FavoritesRestController()
    • 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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        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 interface FavoritesRestOpenApi
        Parameters:
        folderId - Favorites folder id
        userId - User id.
        name - Favorites folder name.
        sessionId - The favorite folder with id.